Patent Description:
The Internet is a non-reliable transmission network. Therefore, a main problem of Internet-based voice transmission is packet loss concealment. Due to instability of the transmission network, a packet loss occurs during transmission. In order to achieve packet loss concealment of the network, a channel encoding algorithm of forward error correction (FEC) redundant encoding is usually used to generate a redundancy packet. The redundancy packet and a data packet are sent to a receiver. After receiving the redundancy packet and the data packet, the receiver recovers a lost data packet by using the redundancy packet and an original packet, thereby achieving packet loss concealment.

However, the FEC redundant encoding relying on the generation of the redundancy packet to achieve packet loss concealment of the transmission network inevitably lead to a multiple increase in bandwidth and excess consumption of network bandwidth resources. A stronger packet loss concealment capability indicates more consumption of network bandwidth, especially for a bandwidth-constrained scenario in which network congestion and other problems are likely to occur and thus cause more packet losses <CIT> discloses adaptive FEC coding in a transmitter. A machine learning module predicts how good a previous part of encoded speech can be predicted from a current part of an encoded speech. If good predictable, no FEC encoding takes place. Otherwise FEC encoding is performed.

A speech transmission method is provided according to claim <NUM>. Optional features are set out in dependent claims <NUM> to <NUM>.

A speech transmission apparatus is provided according to claim <NUM>. Optional features are set out in dependent claims <NUM> to <NUM>.

One or more non-volatile computer-readable storage mediums storing computer-readable instructions are provided according to claim <NUM>.

A computer device is provided according to claim <NUM>.

To describe the technical solutions in the embodiments of the disclosure more clearly, the following briefly describes accompanying drawings required for describing the embodiments. Apparently, the accompanying drawings in the following description show merely some embodiments of the disclosure, and a person skilled in the art may still derive other drawings from these accompanying drawings without creative efforts.

To make the objectives, technical solutions, and advantages of the disclosure clearer and more understandable, the disclosure is further described in detail below with reference to the accompanying drawings and the embodiments. It is to be understood that the specific embodiments described herein are merely used for explaining the disclosure but are not intended to limit the disclosure.

<FIG> is an application environment diagram of a speech transmission method in an embodiment. Referring to <FIG>, the speech transmission method is applied to a speech transmission system. The speech transmission system includes a transmitter <NUM> and a receiver <NUM>. The transmitter <NUM> and the receiver <NUM> are connected through a network. The transmitter <NUM> and the receiver <NUM> each may be a terminal. The terminal may be specifically a desktop terminal or a mobile terminal. The mobile terminal may be specifically at least one of a mobile phone, a tablet computer, and a notebook computer. In some other embodiments, alternatively, the transmitter <NUM> and the receiver <NUM> each may be a server or a server cluster.

As shown in <FIG>, in a specific application scenario, an application supporting a speech transmission function runs on each of the transmitter <NUM> and the receiver <NUM>. The server <NUM> may provide a calculation capability and a storage capability for the application. The transmitter <NUM> and the receiver <NUM> both may be connected to the server <NUM> through a network, thereby implementing speech transmission at the two ends based on the server <NUM>. The server <NUM> may be implemented by using an independent server or a server cluster including multiple servers.

In an embodiment, the transmitter <NUM> may obtain current encoded data in a speech encoding bitstream; obtain a packet loss recovery capability corresponding to the current encoded data according to a first speech encoding feature parameter corresponding to the current encoded data and a second speech encoding feature parameter corresponding to previous encoded data of the current encoded data by using a packet loss recovery capability prediction model based on machine learning; determine, according to the packet loss recovery capability, whether redundant encoding needs to be performed; and perform redundant encoding according to the current encoded data to generate a corresponding redundancy packet, and then transmit the current encoded data and the redundancy packet to the receiver <NUM>, when redundant encoding needs to be performed; or directly transmit the current encoded data to the receiver <NUM> when redundant encoding does not need to be performed. This can effectively improve overall utilization of network bandwidth and also ensure a packet loss concealment capability of a transmission network.

As shown in <FIG>, in an embodiment, a speech transmission method is provided. This embodiment is mainly described by using an example in which the method is applied to the transmitter <NUM> in <FIG>. Referring to <FIG>, the speech transmission method specifically includes the following steps S302 to S308:.

Obtain current encoded data in a speech encoding bitstream.

The speech encoding bitstream is an original bitstream obtained by performing speech encoding on a speech signal. The speech encoding bitstream includes a set of encoded data to be transmitted. The encoded data may be an encoded data frame obtained by encoding the speech signal by a speech encoder at the transmitter according to a specific frame length. The transmitter may transmit the encoded data frame in the speech encoding bitstream to a receiver through a network. The encoded data may alternatively be an encoded data packet obtained by synthesizing multiple encoded data frames. The transmitter may transmit the encoded data packet in the speech encoding bitstream to a receiver through a network. For example, an encoder at the transmitter obtains a speech signal of <NUM>, divides the speech signal into four frames with a frame length of <NUM>, and encodes the frames in sequence, to obtain four encoded data frames. The transmitter may sequentially transmit the encoded data frames to the receiver. The transmitter may alternatively synthesize the four encoded data frames into one encoded data packet, and then transmits the encoded data packet to the receiver through the network.

Usually, to resolve a problem of packet loss concealment of a transmission network, as shown in <FIG>, before transmitting the speech encoding bitstream to the receiver, the transmitter directly sends each piece of encoded data in the speech encoding bitstream to the receiver through FEC redundant encoding. The receiver may receive the each piece of encoded data and corresponding redundancy packets through the network, perform redundant decoding according to the redundancy packets to obtain lost encoded data, and then perform decoding to obtain the speech signal. For example, a speech encoding bitstream to be transmitted includes five pieces of encoded data P1, P2, P3, P4, and P5. The receiver may perform redundant encoding according to the five pieces of encoded data to generate a redundancy packet. There may be one or more redundancy packets. It is assumed herein that two redundancy packets R1 and R2 are generated. P1, P2, P3, P4, and P5 are packaged with R1 and R2 and then sent to the receiver.

In this embodiment provided in the disclosure, after the transmitter encodes original speech information to obtain a speech encoding bitstream, before sending each piece of encoded data in the speech encoding bitstream to the receiver, the transmitter may sequentially predict a packet loss recovery capability of the receiver for the each piece of encoded data in the speech encoding bitstream. Therefore, the transmitter may sequentially obtain the encoded data in the speech encoding bitstream. The current encoded data is encoded data currently to be transmitted to the receiver.

It can be understood that, the current encoded data used in the disclosure is used for describing encoded data being processed by the transmitter currently, and the previous encoded data is used for describing encoded data before the current encoded data in the speech encoding bitstream. The previous encoded data may be one piece of encoded data before the current encoded data, or may be multiple pieces of encoded data before the current encoded data, for example, two pieces of encoded data before the current encoded data. In addition, the current encoded data is a relatively changing object. For example, after the transmitter processes the current encoded data F(i), a next piece of encoded data F(i+<NUM>) of the current encoded data F(i) in the speech encoding bitstream may be used as a new piece of current encoded data, and the current encoded data F(i) is used as previous encoded data of the new piece of current encoded data F(i+<NUM>).

In an embodiment, the foregoing speech transmission method further includes: obtaining an original speech signal; dividing the original speech signal to obtain an original speech sequence; and sequentially performing speech encoding on speech segments in the original speech sequence to obtain a speech encoding bitstream.

For example, the original speech signal obtained by the transmitter is a speech segment of <NUM> seconds, and this segment of speech signal is divided in units of <NUM> milliseconds, to obtain an original speech sequence including <NUM> speech segments. Then, speech encoding is sequentially performed on the speech segments in the original speech sequence, to obtain encoded data corresponding to each speech segment, thereby generating a speech encoding bitstream corresponding to the original speech signal.

In an embodiment, the speech transmission method further includes: obtaining speech encoding feature parameters respectively corresponding to speech segments in an original speech sequence; obtaining a speech encoding bitstream after performing speech encoding on the corresponding speech segments according to the speech encoding feature parameters to generate corresponding encoded data; and caching a speech encoding feature parameter used for each piece of encoded data during speech encoding.

Specifically, during speech encoding, the transmitter extracts speech encoding feature parameters of the speech segments in the original speech sequence, and encodes the extracted speech encoding feature parameters to generate encoded data corresponding to each speech segment. For example, the encoder of the transmitter extracts the speech encoding feature parameters of the speech segments through some speech signal processing models (such as filters and feature extractors), performs encoding (such as entropy coding) on these speech encoding feature parameters, and then packages these encoded parameters in a particular data format to obtain the corresponding encoded data. The transmitter may generate current encoded data corresponding to a current speech segment jointly according to a speech encoding feature parameter of the current speech segment and a speech encoding feature parameter of a previous speech segment, or may generate current encoded data corresponding to a current speech segment jointly according to a speech encoding feature parameter of the current speech segment and a speech encoding feature parameter of a subsequent speech segment. The speech encoding feature parameter may be a line spectral frequency (LSF), a pitch period (Pitch Detection), an adaptive codebook gain (adaptive gain), or a fixed codebook gain extracted by signal processing according to the speech segment, and other parameters.

Further, when generating the encoded data corresponding to the each speech segment, the transmitter further caches the speech encoding feature parameters of the speech segments during decoding, that is, speech encoding feature parameters used when generating all the pieces of encoded data, for subsequently predicting a packet loss recovery capability corresponding to the each piece of encoded data based on the cached speech encoding feature parameters.

Obtain a packet loss recovery capability corresponding to the current encoded data according to a first speech encoding feature parameter corresponding to the current encoded data and a second speech encoding feature parameter corresponding to previous encoded data of the current encoded data by using a packet loss recovery capability prediction model based on machine learning.

The packet loss recovery capability is a prediction result that can reflect a speech quality status of a recovered packet obtained by performing packet loss recovery on the current encoded data by the receiver after the current encoded data is lost. The prediction result indicates whether the receiver can well recover the lost current encoded data or cannot well recover the lost current encoded data. The packet loss recovery is packet loss concealment (PLC). The packet loss recovery capability is a packet loss recovery capability for the PLC.

When there is a sudden change in a value of the speech encoding feature parameter of the encoded data, the packet loss recovery capability of the receiver is limited. For example, when there is pitch hopping, LSF mutation, or the like between adjacent or close encoded data, the packet loss recovery capability of the receiver is limited. In this case, enabling FEC redundant encoding at the transmitter can effectively improve a packet loss rate and thus ensure speech quality at the receiver. In the case of relatively smooth fluctuations in values of speech encoding feature parameters of the adjacent encoded data, the receiver usually has a good packet loss recovery capability. In this case, FEC redundant encoding may not need to be enabled at the transmitter. Based on this, it can be learned that the packet loss recovery capability corresponding to the current encoded data is related to the corresponding speech encoding feature parameter. A machine learning model can be trained with a large quantity of training samples to learn how to predict a packet loss recovery capability corresponding to a data packet according to the speech encoding feature parameter.

Specifically, the transmitter may obtain a cached first speech encoding feature parameter corresponding to the current encoded data and a cached second speech encoding feature parameter corresponding to the previous encoded data, and predict the packet loss recovery capability corresponding to the current encoded data according to the first speech encoding feature parameter and the second speech encoding feature parameter by using a packet loss recovery capability prediction model trained in advance.

In some other embodiments, the transmitter may obtain a packet loss recovery capability corresponding to the current encoded data according to a first speech encoding feature parameter corresponding to the current encoded data and a third speech encoding feature parameter corresponding to subsequent encoded data of the current encoded data by using a packet loss recovery capability prediction model; or obtain a packet loss recovery capability corresponding to the current encoded data according to a second speech encoding feature parameter and/or a third speech encoding feature parameter. The subsequent encoded data is used for describing encoded data after the current encoded data in the speech encoding bitstream. The subsequent encoded data may be one piece of encoded data after the current encoded data, or may be multiple pieces of encoded data after the current encoded data, for example, two pieces of encoded data after the current encoded data.

It can be understood that, speech encoding feature parameters corresponding to the encoded data that are to be used by the transmitter as inputs of the packet loss recovery capability prediction model depend on an algorithm rule used by the transmitter during speech encoding or an algorithm rule used by the receiver during speech decoding. Encoding and decoding rules correspond to each other. For example, if the transmitter needs to generate current encoded data according to a speech encoding feature parameter corresponding to a previous piece of encoded data, during prediction of a packet loss recovery capability corresponding to the current encoded data, the speech encoding feature parameter used for the previous piece of encoded data needs to be used as an input of the packet loss recovery capability prediction model. If the transmitter needs to generate current encoded data according to a speech encoding feature parameter used for a subsequent piece of encoded data, during prediction of a packet loss recovery capability corresponding to the current encoded data, the speech encoding feature parameter used for the subsequent piece of encoded data needs to be used as an input of the packet loss recovery capability prediction model.

The packet loss recovery capability prediction model is a computer model based on machine learning, and may be implemented by using a neural network model. The machine learning model may learn through a sample, and therefore has a specific capability. In this embodiment, the packet loss recovery capability prediction model is a pre-trained model with a predicted packet loss recovery capability.

In an embodiment, the transmitter may preset a model structure of a machine learning model to obtain an initial machine learning model, and then train the initial machine learning model by using a large quantity of sample speech and packet loss simulation tests to obtain model parameters of the machine learning model. Accordingly, when a speech needs to be transmitted through a network, the transmitter may obtain a pre-trained model parameter, then import the model parameter into the initial machine learning model, to obtain a packet loss recovery capability prediction model, and predict, by using the packet loss recovery capability prediction model, a packet loss recovery capability corresponding to each piece of encoded data in the speech encoding bitstream, thereby determining, according to the predicted packet loss recovery capability, whether to enable FEC redundant encoding on the current encoded data.

<FIG> is a schematic flowchart of training steps of a packet loss recovery capability prediction model in an embodiment. The training steps may be performed by any computer device to obtain a trained packet loss recovery capability prediction model, and then the trained packet loss recovery capability prediction model is imported into a transmitter that needs to perform speech transmission. The computer device may alternatively be the transmitter in <FIG>. In other words, the training steps may be directly performed by the transmitter to obtain a trained packet loss recovery capability prediction model. That the computer device is an execution body is used as an example to describe the training steps of the packet loss recovery capability prediction model. Specifically, the following steps are included:.

Obtain a sample speech sequence in a training set.

Specifically, the computer device may obtain a large quantity of speech signals, and divides the speech signals to obtain a large quantity of speech signal sequences including speech segments, as sample speech sequences used for training a machine learning model.

Perform speech encoding on the sample speech sequence to obtain a sample speech encoding bitstream.

Specifically, for each sample speech sequence, the computer device extracts a speech encoding feature parameter corresponding to each speech segment, generates encoded data corresponding to each speech segment according to the extracted speech encoding feature parameter, and obtains a sample speech encoding bitstream corresponding to each sample speech sequence. The computer device may cache the speech encoding feature parameter used for each piece of encoded data during encoding.

Extract, from the sample speech encoding bitstream, a first speech encoding feature parameter used for current encoded data and a second speech encoding feature parameter used for previous encoded data of the current encoded data.

As mentioned above, the packet loss recovery capability corresponding to the encoded data is related to the corresponding speech encoding feature parameter, and may also be related to the speech encoding feature parameter corresponding to the previous encoded data and/or the subsequent encoded data. Therefore, during training, the computer device may use the speech encoding feature parameter as an input of the machine learning model for training. In this embodiment, the transmitter may extract a currently processed first speech encoding feature parameter corresponding to the current encoded data and a second speech encoding feature parameter corresponding to the previous encoded data of the current encoded data as inputs of the machine learning model. As mentioned above, the previous encoded data is one piece of encoded data before the current encoded data, or may be multiple pieces of encoded data before the current encoded data.

A training object for each time of training is a piece of encoded data, and each sample speech encoding bitstream includes multiple pieces of encoded data. Therefore, each sample speech encoding bitstream may be used for multiple times of training. For example, during training, the transmitter may extract a speech encoding feature parameter corresponding to an ith piece of encoded data and a speech encoding feature parameter corresponding to an (i-<NUM>)th piece of encoded data in a sample speech encoding bitstream S, or the transmitter may extract a speech encoding feature parameter corresponding to an (i+<NUM>)th piece of encoded data and a speech encoding feature parameter corresponding to an ith piece of encoded data in a sample speech encoding bitstream S.

Obtain a first speech quality score determined based on a first speech signal obtained by directly decoding the sample speech encoding bitstream.

In order to obtain a target output of the machine learning model for the current training process, the transmitter needs to perform steps S508 to S512. The computer device may directly decode the sample speech encoding bitstream obtained after decoding, to obtain a first speech signal, and then tests a first speech quality score corresponding to the first speech signal by using a speech quality test tool. The first speech signal is obtained by directly decoding the sample speech encoding bitstream, and there is no encoded data loss. Therefore, the obtained first speech signal is very close to an original sample speech sequence, and may be referred to as a lossless speech signal. The corresponding first speech quality score may be referred to as a lossless speech quality score.

In an embodiment, the speech quality test tool may be Perceptual Evaluation of Speech Quality (PESQ). PESQ can objectively evaluate quality of a speech signal according to some measurement standards, thereby providing a fully quantized speech quality measurement method. These measurement standards match well with human perception of speech quality. The obtained first speech quality score may be denoted as MOS_UNLOSS.

Obtain a second speech quality score determined based on a second speech signal obtained after decoding a recovered packet obtained after simulated packet loss recovery is performed on the current encoded data;.

Subsequently, the computer device may use the current encoded data as a lost data packet, simulate a decoder of the receiver to perform packet loss recovery on the current encoded data to obtain a corresponding recovered packet, decodes the recovered packet to obtain a corresponding second speech signal, and splices other speech segments in the original sample speech sequence with the second speech signal for speech quality scoring, to obtain a second speech quality score. The second speech signal is obtained by decoding the recovered packet obtained in a case of simulated packet loss, and there is a loss between the recovered packet and the lost current encoded data. Therefore, there is loss between the obtained second speech signal and the speech segment corresponding to the current encoded data. The second speech signal may be referred to as a lossy speech signal. The determined second speech quality score may be referred to as a lossy speech quality score, denoted as MOS_LOSS.

Determine, according to a score difference between the first speech quality score and the second speech quality score, a real packet loss recovery capability corresponding to the current encoded data.

Specifically, the real packet loss recovery capability corresponding to the current encoded data may be measured by using the score difference between the first speech quality score and the second speech quality score. That is, MOS_UNLOSS - MOS_LOSS may be used as the real packet loss recovery capability corresponding to the current encoded data, that is, a target output of the machine learning model. The real packet loss recovery capability corresponding to the current encoded data is inversely correlated with the score difference. That is, a smaller difference indicates better speech quality of the recovered packet obtained through packet loss recovery performed after simulating the packet loss of the current encoded data, and a stronger real packet loss recovery capability corresponding to the current encoded data. On the contrary, a larger difference indicates poorer speech quality of the recovered packet obtained through packet loss recovery performed after simulating the packet loss of the current encoded data.

Input the first speech encoding feature parameter and the second speech encoding feature parameter into a machine learning model, and output, through the machine learning model, a predicted packet loss recovery capability corresponding to the current encoded data.

After obtaining the target output of the current training process, the computer device may input the obtained first speech encoding feature parameter and the obtained second speech encoding feature parameter into the machine learning model, and output the predicted packet loss recovery capability corresponding to the current encoded data after processing by the internal network. S514 may alternatively be performed before step S508, and the order of execution of this step is not limited in this embodiment.

Adjust a model parameter of the machine learning model according to a difference between the real packet loss recovery capability and the predicted packet loss recovery capability, and then return to the step of obtaining a sample speech sequence in a training set to continue training, until a training end condition is met.

Specifically, the computer device may construct a loss function according to the obtained real packet loss recovery capability and the predicted packet loss recovery capability obtained through the machine learning model. Model parameters obtained after the loss function is minimized are used as latest model parameters of the machine learning model. A next time of training continues to be performed according to the sample speech sequence, until the machine learning model converges or a quantity of training times reaches a preset quantity of times, to obtain a trained packet loss recovery capability prediction model with a packet loss recovery predict capability.

<FIG> is a schematic diagram of a framework for training a machine learning model to obtain a packet loss recovery capability prediction model in an embodiment. <FIG> is a schematic flowchart of a single training process. A computer device obtains a sample speech sequence, and performs speech encoding on the sample speech sequence to obtain a sample speech encoding bitstream. MOS_UNLOSS is first obtained through PESQ by directly decoding the sample speech encoding bitstream in a case of no packet loss in current encoded data, and then MOS_LOSS is obtained through PESQ by decoding the current encoded data after packet loss recovery is simulated on the current encoded data in a case of packet loss in the current encoded data. A speech encoding feature parameter of the current encoded data and a speech encoding feature parameter of previous encoded data of the current encoded data are used as inputs of the machine learning model, to obtain a predicted packet loss recovery capability. MOS_UNLOSS - MOS_LOSS is used as a target output of the machine learning model, that is, a real packet loss recovery capability. Then model parameters of the machine learning model are adjusted according to the predicted packet loss recovery capability and the real packet loss recovery capability, to complete the current training process.

In an embodiment, step S304 of obtaining a packet loss recovery capability corresponding to the current encoded data according to a first speech encoding feature parameter corresponding to the current encoded data and a second speech encoding feature parameter corresponding to previous encoded data of the current encoded data by using a packet loss recovery capability prediction model based on machine learning includes: inputting the first speech encoding feature parameter corresponding to the current encoded data and the second speech encoding feature parameter corresponding to the previous encoded data of the current encoded data into the packet loss recovery capability prediction model; outputting, according to the first speech encoding feature parameter and the second speech encoding feature parameter through the packet loss recovery capability prediction model, a score difference between a first speech quality score determined by directly decoding the current encoded data and a second speech quality score determined by decoding the current encoded data after packet loss recovery is performed on the current encoded data; and determining the packet loss recovery capability corresponding to the current encoded data according to the score difference; the packet loss recovery capability corresponding to the current encoded data being inversely correlated with the score difference.

In this embodiment, before sending the current encoded data in the speech encoding bitstream to the receiver, the transmitter may predict, through a pre-trained packet loss recovery capability prediction model, a packet loss recovery capability corresponding to the current encoded data. Specifically, a first speech encoding feature parameter corresponding to the current encoded data and a second speech encoding feature parameter corresponding to previous encoded data are used as inputs of the packet loss recovery capability prediction model. An output of the packet loss recovery capability prediction model is a score difference between a first speech quality score determined by directly decoding the current encoded data and a second speech quality score determined by decoding the current encoded data after packet loss recovery is performed on the current encoded data. The score difference reflects a quality status of the packet loss recovery performed by the receiver after the packet loss of the current encoded data, that is, the magnitude of the packet loss recovery capability. The packet loss recovery capability is inversely correlated with the score difference. When the score difference is relatively large, that is, the packet loss recovery capability is less than a preset threshold, it indicates relatively poor quality of a speech signal obtained by the receiver through the packet loss recovery after the current encoded data is lost. On the contrary, when the score difference is relatively small, that is, the packet loss recovery capability is greater than the preset threshold, it indicates that the quality of the speech signal obtained by the receiver through the packet loss recovery after the current encoded data is lost falls within an acceptable range.

Determine, according to the packet loss recovery capability, whether redundant encoding needs to be performed; and if yes, perform step S308 to perform redundant encoding according to the current encoded data to generate a corresponding redundancy packet, and then transmit the current encoded data and the redundancy packet to the receiver; or if no, perform step S310 to directly transmit the current encoded data to the receiver.

Specifically, after obtaining the packet loss recovery capability corresponding to the current encoded data through the packet loss recovery capability prediction model, the transmitter determines, according to the predicted packet loss recovery capability, whether to add the current encoded data to FEC redundant encoding.

In an embodiment, the packet loss recovery capability output by the packet loss recovery capability prediction model is a value within a value range. The transmitter may compare the packet loss recovery capability with the preset threshold, and determine, according to a result of the comparison, whether redundant encoding needs to be performed on the current encoded data.

Specifically, when the packet loss recovery capability is less than the preset threshold, redundant encoding is performed according to the current encoded data to generate a corresponding redundancy packet, and then the current encoded data and the redundancy packet are transmitted to the receiver. When the packet loss recovery capability is less than the preset threshold, it indicates relatively poor quality of a speech signal obtained by the receiver through packet loss recovery after the current encoded data is lost. Therefore, the FEC redundant encoding is required to resolve the problem of packet loss concealment of the transmission network. That is, the current encoded data needs to be added to the FEC redundant encoding to generate a redundancy packet and then transmitted to the receiver. When the packet loss recovery capability is greater than the preset threshold, the current encoded data is directly transmitted to the receiver. When the packet loss recovery capability is greater than the preset threshold, it indicates that quality of a speech signal obtained by the receiver through packet loss recovery after the current encoded data is lost falls within an acceptable range. Therefore, for the encoded data, the transmitter does not need to use FEC redundant encoding as a policy for packet loss concealment. The transmitter may directly transmit the current encoded data to the receiver. If the current encoded data is lost, a packet loss recovery algorithm built in the decoder at the receiver is directly used to perform packet loss recovery on the current encoded data.

In an embodiment, there may be two types of packet loss recovery capabilities output by the packet loss recovery capability prediction model. When the packet loss recovery capability is a first value, it indicates that quality of a speech signal obtained by the receiver through packet loss recovery after the current encoded data is lost is relatively poor. In this case, the transmitter needs to perform FEC redundant encoding on the current encoded data and then transmits the encoded data to the receiver. When the packet loss recovery capability is a second value, it indicates that quality of a speech signal obtained by the receiver through packet loss recovery after the current encoded data is lost falls within an acceptable range. In this case, the transmitter may directly transmit the current encoded data to the receiver. If the current encoded data is lost, a packet loss recovery algorithm built in the decoder at the receiver is directly used to perform packet loss recovery on the current encoded data. For example, the first value may be <NUM>, and the second value may be <NUM>. For another example, the first value may be <NUM>, and the second value may be <NUM>.

For example, a speech encoding bitstream to be transmitted includes P1, P2, P3, P4, and so on. It is assumed that the current encoded data is P7, and the transmitter predicts that a packet loss recovery capability corresponding to P7 is relatively weak. In this case, P7 may be added to a cache queue on which redundant encoding needs to be performed (at this time, the cache queue may be empty, or may have already stored the previous encoded data, such as P5). If the cache queue is not filled, a packet loss recovery capability corresponding to subsequent encoded data continues to be predicted, and a subsequent piece of encoded data with a relatively weak packet loss recovery capability is also added to the cache queue, until the cache queue is filled. The transmitter may perform redundant encoding on the encoded data in the cache queue to generate a redundancy packet, and then send the encoded data in the cache queue and the generated redundancy packet to the receiver, while emptying the cache queue.

In an embodiment, the performing redundant encoding according to the current encoded data to generate a corresponding redundancy packet, and then transmitting the current encoded data and the redundancy packet to a receiver includes: obtaining packet loss status information fed back by the receiver; determining, according to the packet loss status information, a redundancy rate corresponding to the current encoded data; and generating a redundancy packet based on the redundancy rate according to the current encoded data, and then transmitting the current encoded data and the redundancy packet to the receiver.

Specifically, the receiver may determine the packet loss status information according to a received data packet, and feed back the packet loss status information to the transmitter. The packet loss status information may be represented by a current packet loss rate. The receiver may encapsulate the packet loss rate into a packet and send the packet to the transmitter. The transmitter parses the received control packet to obtain the packet loss rate. A redundancy rate r may be a ratio of a quantity m of redundancy packets to a sum of the quantity m of redundancy packets and a quantity n of encoded data n, that is, r = m/(m + n). The transmitter may adjust the redundancy rate to implement different degrees of packet loss concealment. That is, a larger redundancy rate can resolve more continuous packet loss problems, and a smaller redundancy rate can resolve a small quantity of packet loss or sporadic packet loss problems. That is, r has a larger value at a higher packet loss rate and a smaller value at a lower packet loss rate.

In an embodiment, the speech transmission method further includes: directly performing speech decoding on the current encoded data when the receiver receives the current encoded data, to obtain a speech signal corresponding to the current encoded data; or performing redundant decoding through the receiver based on the redundancy packet when the receiver does not receive the current encoded data but receives the redundancy packet, to obtain the current encoded data, and then performing speech decoding on the current encoded data, to obtain a speech signal corresponding to the current encoded data.

For example, based on the foregoing example, after predicting the packet loss recovery capability, the transmitter adds encoded data P3, P4, P6, P7, P8, and P9 to a cache queue (a length of the cache queue may be set as required, for example, set to <NUM>), performs redundant encoding to generate redundancy packets R1 and R2, encapsulates the encoded data P3, P4, P6, P7, P8, and P9 in the cache queue and the generated redundancy packets R1 and R2 into a data set, and then sends the data set to the receiver. In order to help the receiver determine whether a packet loss occurs, packet sequence numbers of data packets in the data set may be consecutive, for example, may be <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, and <NUM>. If the receiver receives P3, P4, and P6, because the packet sequence numbers are consecutive, and there is no packet loss, the receiver may directly perform speech decoding according to the received P3, P4, and P6, to obtain a corresponding speech signal. In addition, the receiver may cache P3, P4, and P6, for use in possible subsequent FEC redundant decoding, and if there is no packet loss in this set of data subsequently, clear the cache.

When the receiver receives P8 and P9, the receiver may determine, according to the packet sequence numbers, that P7 is lost. In this case, the receiver caches P8, P9, until R1 is received, and the receiver may perform redundant decoding according to cached P3, P4, P6, P8, P9, and R1 to obtain the lost P7. When R2 is further received, R2 may be directly discarded.

In an embodiment, the speech transmission method further includes:
performing packet loss recovery on the current encoded data through the receiver when the receiver receives neither the current encoded data nor the redundancy packet, to obtain a recovered packet corresponding to the current encoded data, and performing speech decoding on the recovered packet, to obtain a speech signal corresponding to the current encoded data.

Based on the foregoing example, when P7 is lost, if the receiver receives neither R1 nor R2 within a particular period of time, the receiver cannot recover P7 according to cached P3, P4, P6, P8, and P9. In this case, a PLC algorithm built in the decoder needs to be used to perform packet loss recovery on the current encoded data. Usually, the current encoded data is approximately replaced as the recovered packet according to decoding information of a previous data packet by using a pitch synchronous repetition method, and then the recovered packet is decoded to obtain a speech signal. Additionally, a condition for the receiver to be capable of recovering a lost packet in the data set through redundant decoding is: a quantity of pieces of encoded data received by the receiver + a quantity of redundancy packets received by the receiver >= a quantity of pieces of encoded data in the data set. When the condition is not met, the receiver also needs to perform packet loss recovery on the current encoded data by using the PLC algorithm built in the decoder.

According to the foregoing speech transmission method, before the current encoded data is transmitted to the receiver, the packet loss recovery capability of the receiver for the current encoded data is predicted according to the first speech encoding feature parameter corresponding to the current encoded data and the second speech encoding feature parameter corresponding to the previous encoded data by using the packet loss recovery capability prediction model based on machine learning. In this way, it is determined, according to the packet loss recovery capability, whether to perform redundant encoding on the current encoded data. If yes, redundant encoding needs to be performed on the current encoded data to generate a redundancy packet, and then the redundancy packet is transmitted to the receiver by consuming necessary network bandwidth resources. Otherwise, redundant encoding does not need to be performed on the current encoded data. Instead, the current encoded data is directly transmitted to the receiver, avoiding consumption of excess network bandwidth resources, thereby effectively improving overall utilization of network bandwidth and also ensuring a packet loss concealment capability of a transmission network.

<FIG> is a flow block diagram of a speech transmission method in an embodiment. Referring to <FIG>, a transmitter obtains an original speech signal, and performs speech encoding on the original speech signal to obtain a speech encoding bitstream. Subsequently, the transmitter predicts, by using a packet loss recovery capability prediction model based on machine learning, a packet loss recovery capability of a receiver for each piece of encoded data in the speech encoding bitstream. Then, it is determined, according to the predicted packet loss recovery capability, whether to enable FEC redundant encoding for current encoded data. If it is determined to enable FEC redundant encoding for the current encoded data, a redundancy rate is set according to packet loss status information fed back by the receiver, then a redundancy packet is generated based on the redundancy rate according to the current encoded data, and the current encoded data and the redundancy packet are transmitted to the receiver. If it is determined not to enable redundant encoding for the current encoded data, the current encoded data is directly transmitted to the receiver.

If the receiver receives the current encoded data, a speech signal is reconstructed according to a normal decoding procedure. If the receiver does not receive the current encoded data but receives the redundancy packet, under a condition that a lost packet can be recovered through redundant decoding, the receiver can perform FEC redundant decoding to obtain the current encoded data. If the receiver does not receive the current encoded data or the corresponding redundancy packet within a period of time, it is determined that the current encoded data is lost. In this case, the receiver can perform packet loss recovery on the current encoded data by using a PLC algorithm that is built in a decoder, and then perform decoding to obtain a speech signal.

<FIG> is a schematic flowchart of a speech transmission method in a specific embodiment. Referring to <FIG>, the following steps are included:.

It is to be understood that although the steps in the flowcharts of <FIG>, <FIG>, and <FIG> are sequentially displayed in accordance with instructions of arrows, these steps are not necessarily performed sequentially in the order indicated by the arrows. Unless explicitly specified in this specification, execution of the steps is not strictly limited in the sequence, and the steps may be performed in other sequences. In addition, at least some steps in <FIG>, <FIG>, and <FIG> may include a plurality of substeps or a plurality of stages. The substeps or the stages are not necessarily performed at a same moment, and instead may be performed at different moments. A performing sequence of the substeps or the stages is not necessarily performing in sequence, and instead may be performing in turn or alternately with another step or at least some of substeps or stages of the another step.

In an embodiment, a speech transmission system is provided. The speech transmission system may be the speech transmission system shown in <FIG>, and includes the transmitter <NUM> and the receiver <NUM>.

The transmitter <NUM> is configured to obtain current encoded data in a speech encoding bitstream, and obtain a packet loss recovery capability corresponding to the current encoded data according to a first speech encoding feature parameter corresponding to the current encoded data and a second speech encoding feature parameter corresponding to previous encoded data of the current encoded data by using a packet loss recovery capability prediction model based on machine learning.

The transmitter <NUM> is further configured to determine, according to the packet loss recovery capability, whether redundant encoding needs to be performed; and perform redundant encoding according to the current encoded data to generate a corresponding redundancy packet, and then transmit the current encoded data and the redundancy packet to the receiver, when redundant encoding needs to be performed; or directly transmit the current encoded data to the receiver when redundant encoding does not need to be performed;.

The receiver <NUM> is configured to directly perform speech decoding on the current encoded data when the receiver receives the current encoded data, to obtain a speech signal corresponding to the current encoded data; and further configured to perform redundant decoding through the receiver based on the redundancy packet when the receiver does not receive the current encoded data but receives the redundancy packet, to obtain the current encoded data, and then perform speech decoding on the current encoded data, to obtain a speech signal corresponding to the current encoded data.

The receiver <NUM> is further configured to perform packet loss recovery on the current encoded data through the receiver when the receiver receives neither the current encoded data nor the redundancy packet, to obtain a recovered packet corresponding to the current encoded data, and perform speech decoding on the recovered packet, to obtain a speech signal corresponding to the current encoded data.

In an embodiment, the transmitter <NUM> is further configured to obtain an original speech signal; divide the original speech signal to obtain an original speech sequence; and sequentially perform speech encoding on speech segments in the original speech sequence to obtain a speech encoding bitstream.

In an embodiment, the transmitter <NUM> is further configured to obtain speech encoding feature parameters respectively corresponding to speech segments in an original speech sequence; obtain a speech encoding bitstream after performing speech encoding on the corresponding speech segments according to the speech encoding feature parameters to generate corresponding encoded data; and cache a speech encoding feature parameter used for each piece of encoded data during speech encoding.

In an embodiment, the transmitter <NUM> is further configured to input the first speech encoding feature parameter corresponding to the current encoded data and the second speech encoding feature parameter corresponding to the previous encoded data of the current encoded data into the packet loss recovery capability prediction model; output, according to the first speech encoding feature parameter and the second speech encoding feature parameter through the packet loss recovery capability prediction model, a score difference between a first speech quality score determined by directly decoding the current encoded data and a second speech quality score determined by decoding the current encoded data after packet loss recovery is performed on the current encoded data; and determine the packet loss recovery capability corresponding to the current encoded data according to the score difference; the packet loss recovery capability corresponding to the current encoded data being inversely correlated with the score difference.

In an embodiment, the transmitter <NUM> is further configured to obtain packet loss status information fed back by the receiver; determine, according to the packet loss status information, a redundancy rate corresponding to the current encoded data; and generate a redundancy packet based on the redundancy rate according to the current encoded data, and then transmit the current encoded data and the redundancy packet to the receiver.

In an embodiment, the receiver <NUM> is further configured to directly perform speech decoding on the current encoded data when the receiver receives the current encoded data, to obtain a speech signal corresponding to the current encoded data.

In an embodiment, the receiver <NUM> is further configured to perform redundant decoding through the receiver based on the redundancy packet when the receiver does not receive the current encoded data but receives the redundancy packet, to obtain the current encoded data, and then perform speech decoding on the current encoded data, to obtain a speech signal corresponding to the current encoded data.

In an embodiment, the receiver <NUM> is further configured to perform packet loss recovery on the current encoded data through the receiver when the receiver receives neither the current encoded data nor the redundancy packet, to obtain a recovered packet corresponding to the current encoded data, and perform speech decoding on the recovered packet, to obtain a speech signal corresponding to the current encoded data.

In an embodiment, the transmitter <NUM> is further configured to obtain a sample speech sequence in a training set; perform speech encoding on the sample speech sequence to obtain a sample speech encoding bitstream; extract, from the sample speech encoding bitstream, the first speech encoding feature parameter used for the current encoded data and the second speech encoding feature parameter used for the previous encoded data of the current encoded data; obtain a first speech quality score determined based on a first speech signal obtained by directly decoding the sample speech encoding bitstream; obtain a second speech quality score determined based on a second speech signal obtained after decoding a recovered packet obtained after simulated packet loss recovery is performed on the current encoded data; determine, according to a score difference between the first speech quality score and the second speech quality score, a real packet loss recovery capability corresponding to the current encoded data; input the first speech encoding feature parameter and the second speech encoding feature parameter into a machine learning model, and output, through the machine learning model, a predicted packet loss recovery capability corresponding to the current encoded data; and adjust a model parameter of the machine learning model according to a difference between the real packet loss recovery capability and the predicted packet loss recovery capability, and then return to the step of obtaining a sample speech sequence in a training set to continue training, until a training end condition is met.

In the foregoing speech transmission system, before transmitting the current encoded data to the receiver, the transmitter predicts the packet loss recovery capability of the receiver for the current encoded data according to the first speech encoding feature parameter corresponding to the current encoded data and the second speech encoding feature parameter corresponding to the previous encoded data by using the packet loss recovery capability prediction model based on machine learning. In this way, it is determined, according to the packet loss recovery capability, whether to perform redundant encoding on the current encoded data. If yes, redundant encoding needs to be performed on the current encoded data to generate a redundancy packet, and then the redundancy packet is transmitted to the receiver by consuming necessary network bandwidth resources. Otherwise, redundant encoding does not need to be performed on the current encoded data. Instead, the current encoded data is directly transmitted to the receiver, avoiding consumption of excess network bandwidth resources, thereby effectively improving overall utilization of network bandwidth and also ensuring a packet loss concealment capability of a transmission network.

In an embodiment, as shown in <FIG>, a speech transmission apparatus <NUM> is provided. The apparatus can be implemented as all or part of a receiver through software, hardware, or a combination of software and hardware. The apparatus includes an obtaining module <NUM>, a prediction module <NUM>, and a redundant encoding determining module <NUM>.

The obtaining module <NUM> is configured to obtain current encoded data in a speech encoding bitstream.

The prediction module <NUM> is configured to obtain a packet loss recovery capability corresponding to the current encoded data according to a first speech encoding feature parameter corresponding to the current encoded data and a second speech encoding feature parameter corresponding to previous encoded data of the current encoded data by using a packet loss recovery capability prediction model based on machine learning.

The redundant encoding determining module <NUM> is configured to determine, according to the packet loss recovery capability, whether redundant encoding needs to be performed; and perform redundant encoding according to the current encoded data to generate a corresponding redundancy packet, and then transmit the current encoded data and the redundancy packet to the receiver, when redundant encoding needs to be performed; or directly transmit the current encoded data to the receiver when redundant encoding does not need to be performed.

In an embodiment, the speech transmission apparatus <NUM> further includes a speech encoding module, configured to obtain an original speech signal; divide the original speech signal to obtain an original speech sequence; and sequentially perform speech encoding on speech segments in the original speech sequence to obtain a speech encoding bitstream.

In an embodiment, the speech transmission apparatus <NUM> further includes a speech encoding module and a cache module. The speech encoding module is configured to obtain speech encoding feature parameters respectively corresponding to speech segments in an original speech sequence; and obtain a speech encoding bitstream after performing speech encoding on the corresponding speech segments according to the speech encoding feature parameters to generate corresponding encoded data. The cache module is configured to cache a speech encoding feature parameter used for each piece of encoded data during speech encoding.

In an embodiment, the prediction module <NUM> is further configured to input the first speech encoding feature parameter corresponding to the current encoded data and the second speech encoding feature parameter corresponding to the previous encoded data of the current encoded data into the packet loss recovery capability prediction model; output, according to the first speech encoding feature parameter and the second speech encoding feature parameter through the packet loss recovery capability prediction model, a score difference between a first speech quality score determined by directly decoding the current encoded data and a second speech quality score determined by decoding the current encoded data after packet loss recovery is performed on the current encoded data; and determine the packet loss recovery capability corresponding to the current encoded data according to the score difference; the packet loss recovery capability corresponding to the current encoded data being inversely correlated with the score difference.

In an embodiment, the redundant encoding determining module <NUM> is further configured to obtain, when the packet loss recovery capability is less than a preset threshold, packet loss status information fed back by the receiver; determine, according to the packet loss status information, a redundancy rate corresponding to the current encoded data; and generate a redundancy packet based on the redundancy rate according to the current encoded data, and then transmit the current encoded data and the redundancy packet to the receiver.

In an embodiment, the speech transmission apparatus <NUM> further includes a model training module, configured to obtain a sample speech sequence in a training set; perform speech encoding on the sample speech sequence to obtain a sample speech encoding bitstream; extract, from the sample speech encoding bitstream, the first speech encoding feature parameter used for the current encoded data and the second speech encoding feature parameter used for the previous encoded data of the current encoded data; obtain a first speech quality score determined based on a first speech signal obtained by directly decoding the sample speech encoding bitstream; obtain a second speech quality score determined based on a second speech signal obtained after decoding a recovered packet obtained after simulated packet loss recovery is performed on the current encoded data; determine, according to a score difference between the first speech quality score and the second speech quality score, a real packet loss recovery capability corresponding to the current encoded data; input the first speech encoding feature parameter and the second speech encoding feature parameter into a machine learning model, and output, through the machine learning model, a predicted packet loss recovery capability corresponding to the current encoded data; and adjust a model parameter of the machine learning model according to a difference between the real packet loss recovery capability and the predicted packet loss recovery capability, and then return to the step of obtaining a sample speech sequence in a training set to continue training, until a training end condition is met.

Before transmitting the current encoded data to the receiver, the foregoing speech transmission apparatus <NUM> predicts the packet loss recovery capability of the receiver for the current encoded data according to the first speech encoding feature parameter corresponding to the current encoded data and the second speech encoding feature parameter corresponding to the previous encoded data by using the packet loss recovery capability prediction model based on machine learning. In this way, it is determined, according to the packet loss recovery capability, whether to perform redundant encoding on the current encoded data. If yes, redundant encoding needs to be performed on the current encoded data to generate a redundancy packet, and then the redundancy packet is transmitted to the receiver by consuming necessary network bandwidth resources. Otherwise, redundant encoding does not need to be performed on the current encoded data. Instead, the current encoded data is directly transmitted to the receiver, avoiding consumption of excess network bandwidth resources, thereby effectively improving overall utilization of network bandwidth and also ensuring a packet loss concealment capability of a transmission network.

<FIG> is a diagram of an internal structure of a computer device according to an embodiment. The computer device may be specifically the transmitter <NUM> in <FIG>. As shown in <FIG>, the computer device includes a processor, a memory, and a network interface connected by a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system, and may further store computer-readable instructions. The computer-readable instructions, when executed by the processor, may cause the processor to implement a speech transmission method. The internal memory may also store a computer-readable instruction, and when the computer-readable instruction is executed by the processor, the processor may be caused to perform the speech transmission method.

A person skilled in the art may understand that, the structure shown in <FIG> is only a block diagram of a part of a structure related to a solution of the disclosure and does not limit the computer device to which the solution of the disclosure is applied. Specifically, the computer device may include more or fewer members than those in the drawings, or include a combination of some members, or include different member layouts.

In an embodiment, the speech transmission apparatus <NUM> provided in the disclosure may be implemented in a form of computer-readable instructions, and the computer-readable instructions may run on the computer device shown in <FIG>. The memory of the computer device may store program modules forming the speech transmission apparatus <NUM>, for example, the obtaining module <NUM>, the prediction module <NUM>, and the redundant encoding determining module <NUM> shown in <FIG>. A computer-readable instruction formed by the program modules causes a processor to perform the steps in the speech transmission method in the embodiments of the disclosure described in this specification.

For example, the computer device shown in <FIG> may perform step S302 by using the obtaining module <NUM> in the speech transmission apparatus <NUM> shown in <FIG>. The computer device may perform step S304 by using the prediction module <NUM>. The computer device may perform steps S306, S308, and S310 by using the redundant encoding determining module <NUM>.

In an embodiment, a computer device is provided, including: a memory and a processor. The memory stores computer-readable instructions, the computer-readable instructions, when executed by the processor, causing the processor to perform the steps in the foregoing speech transmission method. Herein, the steps of the speech transmission method may be the steps of the speech transmission method in the foregoing embodiments.

In an embodiment, a computer-readable storage medium is provided. The computer-readable storage medium stores computer-readable instructions, the computer-readable instructions, when executed by the processor, causing the processor to perform the steps in the foregoing speech transmission method. Herein, the steps of the speech transmission method may be the steps of the speech transmission method in the foregoing embodiments.

In an embodiment, a computer program product or a computer-readable instruction is provided, the computer program product or the computer-readable instruction includes computer-readable instructions, and the computer-readable instructions are stored in the computer-readable storage medium. The processor of the computer device reads the computer-readable instructions from the computer-readable storage medium, and the processor executes the computer-readable instructions, to cause the computer device to perform the steps in the method embodiments. A person of ordinary skill in the art may understand that all or some of the procedures of the methods of the foregoing embodiments may be implemented by computer-readable instructions instructing relevant hardware. The computer-readable instructions may be stored in a non-volatile computer-readable storage medium. When the computer-readable instructions are executed, the procedures of the embodiments of the foregoing methods may be included. Any reference to a memory, a storage, a database, or another medium used in the embodiments provided in the disclosure may include at least one of a non-volatile memory and a volatile memory. The non-volatile memory may include a read-only memory (ROM), a magnetic tape, a floppy disk, a flash memory, an optical memory, and the like. The volatile memory may include a random access memory (RAM) or an external cache. For the purpose of description instead of limitation, the RAM is available in a plurality of forms, such as a static RAM (SRAM) or a dynamic RAM (DRAM).

The technical features in the above embodiments may be randomly combined. For concise description, not all possible combinations of the technical features in the embodiment are described. However, provided that combinations of the technical features do not conflict with each other, the combinations of the technical features are considered as falling within the scope recorded in this specification.

Claim 1:
A speech transmission method, executable by a computer, the method comprising:
obtaining (S302) current encoded speech data in a speech encoding bitstream;
obtaining (S304), by using a packet loss recovery capability prediction model based on machine learning, a packet loss recovery capability corresponding to the current encoded speech data according to a first speech encoding feature parameter corresponding to the current encoded speech data and a second speech encoding feature parameter corresponding to previous encoded speech data;
determining (S306), according to the packet loss recovery capability, whether redundant encoding needs to be performed;
when the redundant encoding needs to be performed, performing (S308) redundant encoding according to the current encoded speech data to generate a corresponding redundancy packet, followed by transmitting the current encoded speech data and the redundancy packet to a receiver; and
when the redundant encoding does not need to be performed, directly transmitting (S310) the current encoded speech data to the receiver;
obtaining speech encoding feature parameters corresponding to respective speech segments in an original speech sequence;
obtaining a speech encoding bitstream after performing speech encoding on the corresponding speech segments according to the speech encoding feature parameters to generate corresponding encoded speech data;
characterized in that the method further comprises:
in case it is predicted that a packet loss recovery capability corresponding to current encoded data is relatively weak, the current encoded data is added to a cache queue on which redundant encoding needs to be performed and, if the cache queue is not filled, a packet loss recovery capability corresponding to subsequent encoded data continues to be predicted and a subsequent piece of encoded data with a relatively weak packet loss recovery capability is also added to the cache queue, until the cache queue is filled, in which case redundant encoding on the encoded data in the cache queue is performed to generate a redundancy packet, and then the encoded data in the cache queue and the generated redundancy packet are sent to the receiver, while emptying the cache queue.