Method, system and device for speech transmission, computer-readable storage medium and device
Patent Information
- Application Number
- DE602020055709
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-02-20
- Filing Date
- 2020-10-28
- Publication Date
- 2025-07-30
- Estimated Expiration
- 2040-10-28
AI Technical Summary
Existing Internet-based voice transmission methods using Forward Error Correction (FEC) for packet loss concealment lead to excessive bandwidth consumption, particularly in bandwidth-constrained scenarios, causing network congestion and further packet losses.
A speech transmission method that utilizes a packet loss recovery capability prediction model based on machine learning to determine whether redundant encoding is needed, optimizing bandwidth usage by selectively applying FEC only when necessary.
This approach improves network bandwidth utilization while ensuring effective packet loss concealment by dynamically adjusting FEC encoding based on the predicted packet loss recovery capability, reducing excess bandwidth consumption and maintaining speech quality.
Description
FIELD OF THE TECHNOLOGY
[0001] The disclosure relates to the field of computer technologies, and in particular, to a speech transmission method, speech transmission apparatus, a computer-readable storage medium, and a computer device.BACKGROUND OF THE DISCLOSURE
[0002] 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.
[0003] 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 EP3899928 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.SUMMARY
[0004] The invention is set out in the appended set of claims. A speech transmission method is provided according to claim 1. Optional features are set out in dependent claims 2 to 7.
[0005] A speech transmission apparatus is provided according to claim 8. Optional features are set out in dependent claims 9 to 11.
[0006] One or more non-volatile computer-readable storage mediums storing computer-readable instructions are provided according to claim 12.
[0007] A computer device is provided according to claim 13.BRIEF DESCRIPTION OF THE DRAWINGS
[0008] 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. FIG. 1 is an application environment diagram of a speech transmission method in an embodiment. FIG. 2 is an application environment diagram of a speech transmission method in another embodiment. FIG. 3 is a schematic flowchart of a speech transmission method in an embodiment. FIG. 4 is a schematic block diagram of speech transmission by using a FEC redundant encoding mechanism in an embodiment. FIG. 5 is a schematic flowchart of training steps of a packet loss recovery capability prediction model in an embodiment. FIG. 6 is a training block diagram of a packet loss recovery capability prediction model in an embodiment. FIG. 7 is a flow block diagram of a speech transmission method in an embodiment. FIG. 8 is a schematic flowchart of a speech transmission method in a specific embodiment. FIG. 9 is a structural block diagram of a speech transmission apparatus in an embodiment. FIG. 10 is a structural block diagram of a computer device in an embodiment. DESCRIPTION OF EMBODIMENTS
[0009] 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.
[0010] FIG. 1 is an application environment diagram of a speech transmission method in an embodiment. Referring to FIG. 1, the speech transmission method is applied to a speech transmission system. The speech transmission system includes a transmitter 110 and a receiver 120. The transmitter 110 and the receiver 120 are connected through a network. The transmitter 110 and the receiver 120 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 110 and the receiver 120 each may be a server or a server cluster.
[0011] As shown in FIG. 2, in a specific application scenario, an application supporting a speech transmission function runs on each of the transmitter 110 and the receiver 120. The server 130 may provide a calculation capability and a storage capability for the application. The transmitter 110 and the receiver 120 both may be connected to the server 130 through a network, thereby implementing speech transmission at the two ends based on the server 130. The server 130 may be implemented by using an independent server or a server cluster including multiple servers.
[0012] In an embodiment, the transmitter 110 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 120, when redundant encoding needs to be performed; or directly transmit the current encoded data to the receiver 120 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.
[0013] As shown in FIG. 3, 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 110 in FIG. 1 or FIG. 2. Referring to FIG. 3, the speech transmission method specifically includes the following steps S302 to S308:
[0014] S302. Obtain current encoded data in a speech encoding bitstream.
[0015] 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 60 ms, divides the speech signal into four frames with a frame length of 15 ms, 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.
[0016] Usually, to resolve a problem of packet loss concealment of a transmission network, as shown in FIG. 4, 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.
[0017] 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.
[0018] 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+1) 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+1).
[0019] 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.
[0020] For example, the original speech signal obtained by the transmitter is a speech segment of 2 seconds, and this segment of speech signal is divided in units of 20 milliseconds, to obtain an original speech sequence including 100 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.
[0021] 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.
[0022] 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.
[0023] 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.
[0024] S304. 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.
[0025] 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.
[0026] 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.
[0027] 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.
[0028] 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.
[0029] 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.
[0030] 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.
[0031] 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.
[0032] FIG. 5 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. 1 or FIG. 2. 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:
[0033] S502. Obtain a sample speech sequence in a training set.
[0034] 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.
[0035] S504. Perform speech encoding on the sample speech sequence to obtain a sample speech encoding bitstream.
[0036] 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.
[0037] S506. 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.
[0038] 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.
[0039] 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 i th< piece of encoded data and a speech encoding feature parameter corresponding to an (i-1) 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+1) th< piece of encoded data and a speech encoding feature parameter corresponding to an i th< piece of encoded data in a sample speech encoding bitstream S.
[0040] S508. Obtain a first speech quality score determined based on a first speech signal obtained by directly decoding the sample speech encoding bitstream.
[0041] 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.
[0042] 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.
[0043] S510. 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;
[0044] 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.
[0045] S512. 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.
[0046] 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.
[0047] S514. 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.
[0048] 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.
[0049] S516. 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.
[0050] 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.
[0051] FIG. 6 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. 6 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.
[0052] 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.
[0053] 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.
[0054] S306. 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.
[0055] 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.
[0056] 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.
[0057] 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.
[0058] 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 1, and the second value may be 0. For another example, the first value may be 0, and the second value may be 1.
[0059] 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.
[0060] 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.
[0061] 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.
[0062] 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.
[0063] 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 6), 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 1, 2, 3, 4, 5, and 6. 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.
[0064] 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.
[0065] 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.
[0066] 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.
[0067] 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.
[0068] FIG. 7 is a flow block diagram of a speech transmission method in an embodiment. Referring to FIG. 7, 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.
[0069] 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.
[0070] FIG. 8 is a schematic flowchart of a speech transmission method in a specific embodiment. Referring to FIG. 8, the following steps are included: S802. Obtain an original speech signal. S804. Divide the original speech signal to obtain an original speech sequence. S806. Sequentially perform speech encoding on speech segments in the original speech sequence to obtain a speech encoding bitstream. S808. Cache a speech encoding feature parameter used for each piece of encoded data during speech encoding. S810. Obtain current encoded data in the speech encoding bitstream. S812. Input 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 into a packet loss recovery capability prediction model. S814. 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. S816. Determine a packet loss recovery capability corresponding to the current encoded data according to the score difference. S818. Obtain, when the packet loss recovery capability is less than a preset threshold, packet loss status information fed back by a 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. S820. Directly transmit the current encoded data to a receiver when the packet loss recovery capability is greater than a preset threshold. S822. 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. S824. 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. S826. 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.
[0071] It is to be understood that although the steps in the flowcharts of FIG. 3, FIG. 5, and FIG. 8 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. 3, FIG. 5, and FIG. 8 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.
[0072] In an embodiment, a speech transmission system is provided. The speech transmission system may be the speech transmission system shown in FIG. 1 or FIG. 2, and includes the transmitter 110 and the receiver 120.
[0073] The transmitter 110 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.
[0074] The transmitter 110 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;
[0075] The receiver 120 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.
[0076] The receiver 120 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.
[0077] In an embodiment, the transmitter 110 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.
[0078] In an embodiment, the transmitter 110 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.
[0079] In an embodiment, the transmitter 110 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.
[0080] In an embodiment, the transmitter 110 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.
[0081] In an embodiment, the receiver 120 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.
[0082] In an embodiment, the receiver 120 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.
[0083] In an embodiment, the receiver 120 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.
[0084] In an embodiment, the transmitter 110 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.
[0085] 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.
[0086] In an embodiment, as shown in FIG. 9, a speech transmission apparatus 900 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 902, a prediction module 904, and a redundant encoding determining module 906.
[0087] The obtaining module 902 is configured to obtain current encoded data in a speech encoding bitstream.
[0088] The prediction module 904 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.
[0089] The redundant encoding determining module 906 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.
[0090] In an embodiment, the speech transmission apparatus 900 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.
[0091] In an embodiment, the speech transmission apparatus 900 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.
[0092] In an embodiment, the prediction module 904 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.
[0093] In an embodiment, the redundant encoding determining module 906 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.
[0094] In an embodiment, the speech transmission apparatus 900 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.
[0095] Before transmitting the current encoded data to the receiver, the foregoing speech transmission apparatus 900 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.
[0096] FIG. 10 is a diagram of an internal structure of a computer device according to an embodiment. The computer device may be specifically the transmitter 110 in FIG. 1. As shown in FIG. 10, 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.
[0097] A person skilled in the art may understand that, the structure shown in FIG. 10 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.
[0098] In an embodiment, the speech transmission apparatus 900 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. 10. The memory of the computer device may store program modules forming the speech transmission apparatus 900, for example, the obtaining module 902, the prediction module 904, and the redundant encoding determining module 906 shown in FIG. 9. 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.
[0099] For example, the computer device shown in FIG. 10 may perform step S302 by using the obtaining module 902 in the speech transmission apparatus 900 shown in FIG. 9. The computer device may perform step S304 by using the prediction module 904. The computer device may perform steps S306, S308, and S310 by using the redundant encoding determining module 906.
[0100] 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.
[0101] 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.
[0102] 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).
[0103] 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.
[0104] The foregoing embodiments only show several implementations of the disclosure, and descriptions thereof are in detail, but are not to be understood as a limitation to the patent scope of the disclosure. A person of ordinary skill in the art may further make several variations and improvements without departing from the ideas of the disclosure, and such variations and improvements all fall within the protection scope of the disclosure. Therefore, the protection scope of the disclosure shall be subject to the protection scope of the appended claims.
Claims
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.
2. The method according to claim 1, further comprising: obtaining (S802) an original speech signal; dividing (S804) the original speech signal to obtain an original speech sequence; and sequentially performing (S806) speech encoding on speech segments in the original speech sequence to obtain a speech encoding bitstream.
3. The method according to claim 1, wherein obtaining (S304), by using the packet loss recovery capability prediction model based on machine learning, the packet loss recovery capability corresponding to the current encoded speech data according to the first speech encoding feature parameter corresponding to the current encoded speech data and the second speech encoding feature parameter corresponding to the previous encoded speech data comprises: inputting (S812) the first speech encoding feature parameter corresponding to the current encoded speech data and the second speech encoding feature parameter corresponding to the previous encoded speech data into the packet loss recovery capability prediction model; outputting (S814), 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 speech data and a second speech quality score determined by decoding the current encoded speech data after packet loss recovery is performed on the current encoded speech data; and determining (S816) the packet loss recovery capability corresponding to the current encoded speech data according to the score difference; the packet loss recovery capability corresponding to the current encoded speech data being inversely correlated with the score difference.
4. The method according to claim 1, wherein performing (S308) the redundant encoding according to the current encoded speech data to generate the corresponding redundancy packet, followed by transmitting the current encoded speech data and the redundancy packet to the receiver comprises: obtaining (S818) packet loss status information fed back by the receiver; determining (S818), according to the packet loss status information, a redundancy rate corresponding to the current encoded speech data; and generating (S818) a redundancy packet based on the redundancy rate according to the current encoded speech data, followed by transmitting the current encoded speech data and the redundancy packet to the receiver.
5. The method according to claim 1, further comprising: when the receiver receives the current encoded speech data, directly performing (S822) speech decoding on the current encoded speech data, to obtain a speech signal corresponding to the current encoded speech data; or when the receiver does not receive the current encoded speech data and receives the redundancy packet, performing (S824) redundant decoding through the receiver based on the redundancy packet, to obtain the current encoded speech data, followed by performing speech decoding on the current encoded speech data, to obtain a speech signal corresponding to the current encoded speech data.
6. The method according to claim 1, further comprising: when the current encoded speech data and the redundancy packet are not received by the receiver, performing (S826) packet loss recovery on the current encoded speech data through the receiver, to obtain a recovered packet corresponding to the current encoded speech data, and performing speech decoding on the recovered packet, to obtain a speech signal corresponding to the current encoded speech data.
7. The method according to any one of claims 1 to 6, wherein the packet loss recovery capability prediction model is determined by the following operations: obtaining (S502) a sample speech sequence in a training set; performing (S504) speech encoding on the sample speech sequence to obtain a sample speech encoding bitstream; extracting (S506), from the sample speech encoding bitstream, the first speech encoding feature parameter used for the current encoded speech data and the second speech encoding feature parameter used for the previous encoded speech data; obtaining (S508) a first speech quality score determined based on a first speech signal obtained by directly decoding the sample speech encoding bitstream; obtaining (S510) 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 speech data; determining (S512), 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 speech data; inputting (S514) the first speech encoding feature parameter and the second speech encoding feature parameter into a machine learning model, and outputting, through the machine learning model, a predicted packet loss recovery capability corresponding to the current encoded speech data; and adjusting (5516) 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 returning to the operation of obtaining a sample speech sequence in a training set to continue training, until a training end condition is met.
8. A speech transmission apparatus (900), comprising: an obtaining module (902), configured to obtain current encoded speech data in a speech encoding bitstream; a prediction module (904), configured to obtain, 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; and a redundant encoding determining module (906), configured to determine, according to the packet loss recovery capability, whether redundant encoding needs to be performed; when the redundant encoding needs to be performed, perform 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 transmit the current encoded speech data to the receiver; a speech encoding module, 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 speech data; characterized in that the speech transmission apparatus further comprises: a cache module, configured to: in case it is predicted that a packet loss recovery capability corresponding to current encoded data is relatively weak, adding the current encoded data 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.
9. The apparatus according to claim 8, wherein the speech transmission apparatus further comprises 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.
10. The apparatus according to claim 8, wherein the prediction module (904) is further configured to input the first speech encoding feature parameter corresponding to the current encoded speech data and the second speech encoding feature parameter corresponding to the previous encoded speech 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 speech data and a second speech quality score determined by decoding the current encoded speech data after packet loss recovery is performed on the current encoded speech data; and determine the packet loss recovery capability corresponding to the current encoded speech data according to the score difference; the packet loss recovery capability corresponding to the current encoded speech data being inversely correlated with the score difference.
11. The apparatus according to claim 8, wherein the redundant encoding determining module (906) is further configured to, when the receiver receives the current encoded speech data, directly perform speech decoding on the current encoded speech data, to obtain a speech signal corresponding to the current encoded speech data; and when the receiver does not receive the current encoded speech data and receives the redundancy packet, perform redundant decoding through the receiver based on the redundancy packet, to obtain the current encoded speech data, followed by performing speech decoding on the current encoded speech data, to obtain a speech signal corresponding to the current encoded speech data; and wherein the redundant encoding determining module (906) is further configured to perform packet loss recovery on the current encoded speech data through the receiver when the current encoded speech data and the redundancy packet are not received by the receiver, to obtain a recovered packet corresponding to the current encoded speech data, and perform speech decoding on the recovered packet, to obtain a speech signal corresponding to the current encoded speech data.
12. One or more non-volatile computer-readable storage mediums storing computer-readable instructions, the computer-readable instructions, when executed by one or more processors, causing the one or more processors to perform operations of the method according to any one of claims 1 to 7.
13. A computer device, comprising a memory and one or more processors, the memory storing computer-readable instructions, and the computer-readable instructions, when executed by the one or more processors, causing the one or more processors to perform operations of the method according to any one of claims 1 to 7.