Audio transmission method and device, equipment and storage medium
By blocking and interleaving the encoded digital audio signals, the problem of high audio transmission delay in the prior art is solved, and lower latency and higher quality audio transmission is achieved.
Patent Information
- Application Number
- CN202411583952.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-28
AI Technical Summary
Existing audio transmission methods usually use retransmission mechanisms when facing packet loss problems, resulting in high latency.
By blocking and interleaving the encoded digital audio signal, a second data block is obtained and the data block is sent to the second terminal to recover and audio reconstruction, thereby reducing dependence on the retransmission mechanism.
Reduces audio transmission delay, improves audio quality and real-time, and reduces the use of system resources.
Smart Images

Figure CN119541507A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of digital communications, and in particular to an audio transmission method, apparatus, device and storage medium. Background Art
[0002] In the field of digital audio transmission, packet loss is a common problem. Due to factors such as network congestion, delay, jitter or transmission errors, data packets may be lost during transmission, resulting in the inability of the receiving end to fully reconstruct the original audio signal.
[0003] Current audio transmission methods usually use a retransmission mechanism when facing packet loss problems, but the retransmission mechanism will cause higher delays.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of the present application is to provide an audio transmission method, apparatus, device and storage medium, aiming to solve the technical problem that the current audio transmission method adopts a retransmission mechanism resulting in high delay.
[0006] To achieve the above object, the present application proposes an audio transmission method, which is applied to a first terminal, and the method includes:
[0007] Acquire digital audio signal;
[0008] Encoding the digital audio signal according to a preset audio encoding format to obtain an encoded digital audio signal;
[0009] Divide the encoded digital audio signal into blocks to obtain a first data block;
[0010] Performing interleaving processing on the first data block to obtain a second data block;
[0011] The second data block is sent to the second terminal so that the second terminal recovers the second data block to obtain a fourth data block, and audio is reconstructed based on the fourth data block to obtain a reconstructed digital audio signal.
[0012] In one embodiment, the step of acquiring the digital audio signal comprises:
[0013] Collect analog audio signals from microphones via sound drivers;
[0014] The analog audio signal is converted into the digital audio signal through PCM pulse code modulation.
[0015] In one embodiment, before the step of interleaving the first data block to obtain the second data block, the step includes:
[0016] Performing real-time transport protocol encapsulation on the first data block to obtain a first data block carrying a real-time transport protocol message extension header;
[0017] The step of performing interleaving processing on the first data block to obtain the second data block comprises:
[0018] Interleaving is performed on the first data block carrying the real-time transport protocol message extension header to obtain the second data block.
[0019] In one embodiment, the step of dividing the encoded digital audio signal into blocks to obtain a first data block includes:
[0020] Divide the encoded digital audio signal into blocks based on a preset time interval to obtain the first data block;
[0021] The step of performing interleaving processing on the first data block to obtain the second data block comprises:
[0022] A preset number of first data blocks are divided into a group for interleaving to obtain the second data block.
[0023] The present application also proposes an audio transmission method, which is applied to a second terminal, and the method includes:
[0024] receiving a second data block sent by a first terminal, where the second data block is obtained by encoding the digital audio signal according to a preset audio coding format by the first terminal after the first terminal acquires the digital audio signal, obtaining an encoded digital audio signal, dividing the encoded digital audio signal into blocks to obtain a first data block, and performing interleaving processing on the first data block;
[0025] Restoring the second data block to obtain a fourth data block;
[0026] Audio reconstruction is performed based on the fourth data block to obtain a reconstructed digital audio signal.
[0027] In one embodiment, the step of recovering the second data block to obtain the fourth data block includes:
[0028] Performing anti-jitter processing on the second data block to obtain a third data block;
[0029] Deinterleaving the third data block and marking the lost data block;
[0030] Based on the third data block, the lost data block is restored by an interpolation algorithm to obtain the fourth data block.
[0031] In one embodiment, the step of performing audio reconstruction based on the fourth data block to obtain a reconstructed digital audio signal includes:
[0032] Decoding the digital audio signal according to the audio coding format to obtain a decoded digital audio signal;
[0033] Converting the decoded digital audio signal into an analog audio signal by PCM pulse code modulation;
[0034] The analog audio signal is output to a speaker for playing through a sound driver.
[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes an audio transmission device, which is arranged in a first terminal, and the device includes:
[0036] A signal acquisition module, used for acquiring a digital audio signal;
[0037] An encoding module, used to encode the digital audio signal according to a preset audio encoding format to obtain an encoded digital audio signal;
[0038] A block division module, used for dividing the encoded digital audio signal into blocks to obtain a first data block;
[0039] An interleaving processing module, configured to perform an interleaving process on the first data block to obtain a second data block;
[0040] The sending module is used to send the second data block to the second terminal, so that the second terminal recovers the second data block to obtain a fourth data block, and reconstructs the audio based on the fourth data block to obtain a reconstructed digital audio signal.
[0041] In addition, to achieve the above-mentioned purpose, the present application also proposes an audio transmission device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the audio transmission method described above.
[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the audio transmission method described above are implemented.
[0043] One or more technical solutions proposed in this application have at least the following technical effects:
[0044] The present application obtains a second data block by dividing and interleaving the encoded digital audio signal, and sends the second data block to the second terminal through the first terminal, so that the second terminal recovers the second data block and reconstructs the audio, thereby reducing the reliance on the retransmission mechanism. The encoded digital audio signal is divided and interleaved on the sending side, and the second data block is recovered and the audio is reconstructed on the receiving side, thereby reducing the audio transmission delay and improving the audio quality, thereby improving the real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0047] Figure 1 A flowchart of the first embodiment of the audio transmission method of the present application is provided;
[0048] Figure 2 A schematic diagram of a first data block carrying a real-time transport protocol message extension header in the audio transmission method of the present application;
[0049] Figure 3a This is a schematic diagram of the original order of data blocks in the audio transmission method of this application;
[0050] Figure 3b This is a schematic diagram of the sequence after data blocks are interleaved in the audio transmission method of the present application;
[0051] Figure 4a A schematic diagram of a second data block received by a second terminal in the audio transmission method of the present application;
[0052] Figure 4b This is a schematic diagram of the sequence after deinterleaving of data blocks in the audio transmission method of the present application;
[0053] Figure 5 This is a schematic diagram of the sequence after the data block is interpolated and restored in the audio transmission method of the present application;
[0054] Figure 6 A schematic diagram of the process of audio transmission in the audio transmission method of the present application;
[0055] Figure 7 A schematic diagram showing the comparison between the audio transmission method of the present application and the prior art;
[0056] Figure 8 This is a schematic diagram of the module structure of the audio transmission device according to an embodiment of the present application;
[0057] Fig. 9 This is a schematic diagram of the device structure of the hardware operating environment involved in the audio transmission method in the embodiment of the present application.
[0058] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0059] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0060] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0061] The main solution of the embodiment of the present application is: obtaining a digital audio signal; encoding the digital audio signal according to a preset audio coding format to obtain an encoded digital audio signal; dividing the encoded digital audio signal into blocks to obtain a first data block; interleaving the first data block to obtain a second data block; sending the second data block to a second terminal so that the second terminal recovers the second data block to obtain a fourth data block, and reconstructing the audio based on the fourth data block to obtain a reconstructed digital audio signal.
[0062] In this embodiment, for ease of description, the following description is made taking the audio transmission system as the execution subject.
[0063] The current audio transmission method usually adopts a retransmission mechanism when facing the packet loss problem, but the retransmission mechanism will cause a higher delay.
[0064] The present application provides a solution. The present application obtains a second data block by dividing and interleaving the encoded digital audio signal, and sends the second data block to the second terminal through the first terminal, so that the second terminal recovers the second data block and reconstructs the audio, thereby reducing the dependence on the retransmission mechanism. The encoded digital audio signal is divided and interleaved on the sending side, and the second data block is recovered and the audio is reconstructed on the receiving side, thereby reducing the audio transmission delay and improving the audio quality, thereby improving the real-time performance.
[0065] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, an audio transmission device, etc. that can realize the above functions, or an electronic system, an audio transmission system that can realize the above functions. The following takes the audio transmission system as an example to illustrate this embodiment and the following embodiments.
[0066] The widely used anti-packet loss technologies include the following three:
[0067] (I) Forward Error Correction
[0068] FEC (Forward Error Correction) technology adds redundant data at the sending end so that the receiving end can use the redundant data to recover the lost information when data packets are lost.
[0069] Hardware implementation: includes dedicated FEC encoding and decoding chips to efficiently handle the encoding and decoding process of data packets.
[0070] Software implementation: Includes a library of various FEC algorithms, such as Reed-Solomon coding and low-density parity check (LDPC).
[0071] Algorithm disadvantages: FEC increases the amount of data transmitted, thereby increasing bandwidth requirements and latency.
[0072] Technical issue: In a high packet loss environment, the amount of redundant data in FEC increases, which may cause network congestion and further packet loss.
[0073] (II) Retransmission Mechanism
[0074] After the receiving end detects the lost data packet, it sends a request asking the sending end to retransmit the lost data packet.
[0075] Hardware implementation: includes network interface card (NIC) and transmission controller, which can handle the retransmission request of data packets.
[0076] Software implementation: Based on the retransmission mechanism of the RTP (Real-time Transport Protocol), data packet status feedback and retransmission request are performed through RTCP (Realtime Transport Control Protocol).
[0077] Algorithm disadvantages: The retransmission mechanism increases latency, especially in the case of high packet loss rate and network congestion, retransmission may further delay the recovery of the audio stream.
[0078] Technical issue: Delays in retransmission requests may cause prolonged audio interruption and reduce real-time performance.
[0079] 3. Packet loss concealment
[0080] Packet loss concealment technology uses information from received packets to estimate the contents of lost packets to reduce audio interruptions and distortion.
[0081] Hardware implementation: includes DSP (digital signal processor) for real-time processing and estimation of lost packets.
[0082] Software implementation: Interpolation algorithms based on historical data, such as linear interpolation and spline interpolation.
[0083] Algorithm disadvantages: PLC (Programmable Logic Controller) mainly relies on the received data for estimation. In the case of multiple consecutive data packet loss, the recovery effect is limited, which may cause obvious sound quality degradation.
[0084] Technical problem: In complex audio signals (such as music), simple interpolation algorithms have difficulty restoring complex audio features.
[0085] Based on this, the present application embodiment provides an audio transmission method, referring to Figure 1 , Figure 1 A flowchart of the first embodiment of the audio transmission method of the present application is provided.
[0086] In this embodiment, the audio transmission method is applied to the first terminal, including steps S10-S30, S50-S60:
[0087] Step S10, acquiring a digital audio signal;
[0088] Here, a digital audio signal may be captured or received from a source (eg, a microphone, an audio file, an audio input device, etc.).
[0089] As an implementation manner, an analog audio signal may be collected from a microphone through a sound driver, and the analog audio signal may be converted into the digital audio signal through PCM pulse code modulation.
[0090] Step S20, encoding the digital audio signal according to a preset audio encoding format to obtain an encoded digital audio signal;
[0091] Among them, the preset audio coding format can be G.711, G.729, AAC, etc.
[0092] Step S30, dividing the encoded digital audio signal into blocks to obtain a first data block;
[0093] The block division of the encoded digital audio signal may include but is not limited to the following three schemes:
[0094] (1) Fixed-size chunking: The encoded digital audio signal is chunked into fixed-size chunks according to a fixed number of bytes or samples. For example, each chunk contains 1024 samples or 4096 bytes.
[0095] (2) Content-based dynamic segmentation: Dynamically adjust the segment size according to the content of the audio signal (such as silence, high volume, specific frequency components, etc.).
[0096] (3) Overlapping blocks: There is a certain amount of overlap between each data block so that the continuity of the audio signal can be better preserved in subsequent processing.
[0097] Step S50, performing interleaving processing on the first data block to obtain a second data block;
[0098] It should be noted that interleaving the first data blocks can disperse continuous data blocks during transmission.
[0099] The interleaving process for the first data block may include but is not limited to the following three schemes:
[0100] (1) Simple interleaving: The samples in a data block are rearranged according to a specific pattern, for example, the samples of the left channel and the right channel are placed alternately.
[0101] (2) Complex interleaving: Use more complex interleaving patterns, such as time-based interleaving, frequency-based interleaving, etc. These interleaving patterns may involve rearranging samples of multiple data blocks.
[0102] (3) Adaptive interleaving: Dynamically adjust the interleaving pattern according to the characteristics of the audio signal (such as signal strength, frequency distribution, etc.).
[0103] Step S60: sending the second data block to the second terminal so that the second terminal recovers the second data block to obtain a fourth data block, and reconstructs audio based on the fourth data block to obtain a reconstructed digital audio signal.
[0104] It should be noted that, in this embodiment, after the second terminal receives the second data block, assuming that the second data block has a packet loss rate of 60%, some data packets are randomly lost. At this time, the second terminal recovers the second data block to obtain a fourth data block, and reconstructs the audio based on the fourth data block to obtain a reconstructed digital audio signal.
[0105] As an implementation manner, the second terminal may perform deinterleaving and interpolation processing on the second data block when recovering the second data block.
[0106] Deinterleaving is the reverse process of interleaving. Interleaving is to improve the robustness of data transmission or storage by rearranging the original data according to specific rules. Deinterleaving is to restore the interleaved data to the original data order according to the same rules. In audio signal processing, deinterleaving is usually used to restore the data order that has been disrupted by interleaving for subsequent decoding or playback processing.
[0107] Interpolation is a method of estimating unknown data points using known data points. In digital signal processing, interpolation is often used to fill in missing data in a signal or to smooth transitions between data. For audio signals, interpolation can be used to repair discontinuous or missing parts of a signal caused by transmission errors, sampling rate conversion, or editing operations. Through interpolation, a smoother and more continuous audio signal can be generated, improving the auditory quality of the audio.
[0108] After the audio reconstruction is completed, the audio data will be sent to the playback device (such as a speaker) for playback. To further improve the sound quality, the following two post-processing steps can be considered:
[0109] (1) Smoothing: Smoothing the interpolated audio data to eliminate discontinuity or abruptness that may be caused by interpolation. Commonly used smoothing methods include low-pass filtering or moving average.
[0110] (2) Volume Normalization: The interpolated audio blocks may have slight differences in volume. Volume normalization can make the audio volume more consistent and improve the listening experience.
[0111] This embodiment provides an audio transmission method, which obtains a second data block by dividing and interleaving the encoded digital audio signal, and sends the second data block to the second terminal through the first terminal, so that the second terminal can recover the second data block and reconstruct the audio, thereby reducing the reliance on the retransmission mechanism, dividing and interleaving the encoded digital audio signal on the sending side, and recovering and reconstructing the audio on the receiving side, thereby reducing the audio transmission delay and improving the audio quality and real-time performance. In addition, the present application solves the technical problems of the prior art in high packet loss rate environments, such as audio quality degradation, delay problems, insufficient complex audio signal processing capabilities, high system resource usage, and poor adaptability to network environments, through unique and efficient data interleaving, optimized interpolation algorithms, and dynamic anti-packet loss strategies.
[0112] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be described in detail later. On this basis, step S10, obtaining the digital audio signal also includes steps S11 to S12:
[0113] Step S11, collecting analog audio signals from a microphone through a sound driver;
[0114] Among them, the microphone converts sound fluctuations into analog electrical signals, which are continuously changing voltages or currents that represent the waveform of the sound. The sound driver is a software component that is responsible for communicating with the microphone hardware, reading the analog audio signals produced by the microphone, and transmitting them to the further processing units of the computer system.
[0115] Step S12: Convert the analog audio signal into the digital audio signal through PCM pulse code modulation.
[0116] Among them, the analog audio signal is converted into a digital format for digital processing, storage or transmission. PCM (Pulse Code Modulation) is a commonly used analog-to-digital conversion technology. It first samples the analog signal, that is, selects a series of discrete time points in the continuous signal. Then, each sampled value is quantized and converted to the closest discrete value. Finally, these quantized values are encoded to generate a digital audio signal.
[0117] The embodiments of the present application constitute a bridge from analog audio input to digital audio signal processing, providing a basis for subsequent audio analysis, processing, storage and transmission.
[0118] It should be noted that the traditional RTP audio transmission method will significantly reduce the audio quality in a high packet loss rate environment, resulting in discontinuous, distorted or interrupted sound.
[0119] In view of the above problems, based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction, and will not be repeated in the following. On this basis, step S50, interleaving the first data block to obtain the second data block also includes step S40:
[0120] Step S40, performing real-time transport protocol encapsulation on the first data block to obtain a first data block carrying a real-time transport protocol message extension header;
[0121] It should be noted that, in order to speed up the recovery process of the audio stream, the RTP packet extension header can be used to carry additional audio-specific information for recovery.
[0122] like Figure 2 As shown, Figure 2 This is a schematic diagram of the first data block carrying the real-time transport protocol message extension header in the audio transmission method of the present application.
[0123] The first data block includes an RTP header, an extension header, important parameters in the recovery process, and a data packet.
[0124] The extended header includes an extended header type, an extended header length and characteristic parameters, and the data packet is audio data.
[0125] Exemplarily, the extended header may include a data block index, a data timestamp, and spectrum characteristic parameters:
[0126] The data block index may indicate the position of the data block in the original sequence.
[0127] Data timestamps can mark real-time information in data blocks and help with time synchronization.
[0128] Spectral characteristic parameters, such as the amplitude and frequency content of the signal, help reconstruct the lost part during the recovery process.
[0129] The step S50 of performing interleaving processing on the first data block to obtain the second data block further comprises the step S51:
[0130] Step S51, interleaving the first data block carrying the real-time transport protocol message extension header to obtain the second data block.
[0131] It should be noted that the sending end interleaves the first data block carrying the real-time transport protocol message extension header, and the receiving end deinterleaves and interpolates the data. The RTP packet extension header carries additional audio special information, which can help speed up the recovery process of the audio stream.
[0132] The embodiment of the present application can significantly improve the audio quality and reduce audio interruption and distortion in a high packet loss rate environment by introducing efficient data interleaving. In addition, the RTP packet extension header in the embodiment of the present application carries additional audio-specific information, which can help accelerate the recovery process of the audio stream.
[0133] Based on the first embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be described in detail later. On this basis, step S30, dividing the encoded digital audio signal into blocks, and obtaining the first data block includes step S31:
[0134] Step S31, dividing the encoded digital audio signal into blocks based on a preset time interval to obtain the first data block;
[0135] For example, it is assumed that the sampling rate of the audio stream is 8000 Hz, and each 20 ms is divided into a data block, and each data block contains 160 sampling points.
[0136] The step S50 of performing interleaving processing on the first data block to obtain the second data block includes the step S51:
[0137] Step S51: group a preset number of first data blocks into a group for interleaving to obtain the second data blocks.
[0138] Exemplarily, every 4 data blocks are grouped into one group and interleaved.
[0139] like Figure 3a and Figure 3b As shown, Figure 3a This is a schematic diagram of the original order of data blocks in the audio transmission method of this application. Figure 3b This is a schematic diagram of the sequence after data blocks are interleaved in the audio transmission method of the present application;
[0140] The interleaving process may be regarded as exchanging rows and columns of the first data block matrix to obtain the second data block.
[0141] The embodiment of the present application obtains the second data block by dividing a preset number of first data blocks into a group for interleaving processing, thereby disrupting the continuity of each original data block, and even if some data packets are lost, it will not cause the loss of continuous data blocks.
[0142] The existing retransmission mechanism will cause significant delays when there is a high packet loss rate or network congestion, seriously affecting the experience of real-time audio applications. In addition, the existing anti-packet loss technology combination is complex and has high computational overhead, resulting in excessive system resource usage, which is a bottleneck, especially for embedded devices with limited resources.
[0143] In view of the above problem, the fifth embodiment of the present application further provides an audio transmission method, which is applied to the second terminal. The method includes steps S110 to S130:
[0144] Step S110, receiving a second data block sent by the first terminal, where the second data block is obtained by encoding the digital audio signal according to a preset audio coding format by the first terminal after the first terminal acquires the digital audio signal, obtaining an encoded digital audio signal, dividing the encoded digital audio signal into blocks to obtain a first data block, and performing interleaving processing on the first data block;
[0145] Step S120, recovering the second data block to obtain a fourth data block;
[0146] In the second terminal, if data packet loss is detected, an interpolation algorithm may be used to estimate the lost data block.
[0147] The interpolation algorithm may perform linear interpolation or more complex waveform estimation based on adjacent data blocks.
[0148] Step S130: reconstruct the audio signal based on the fourth data block to obtain a reconstructed digital audio signal.
[0149] The embodiment of the present application reduces the reliance on the retransmission mechanism and adopts more efficient forward error correction and packet loss concealment technology to reduce audio transmission delay and improve real-time performance. The embodiment of the present application reduces unnecessary calculations and memory usage, reduces resource consumption, and improves system efficiency by streamlining and optimizing the anti-packet loss technology combination.
[0150] Existing packet loss concealment technologies have poor recovery effects when processing complex audio signals (such as music), which may cause significant degradation in sound quality. In addition, existing technical solutions have poor adaptability in different network environments and are difficult to maintain stable audio transmission quality under diverse network conditions.
[0151] In view of the above problems, based on the fifth embodiment of the present application, in the sixth embodiment of the present application, the same or similar contents as those in the fifth embodiment can be referred to the above introduction, and will not be described in detail later. On this basis, step S120, recovering the second data block to obtain the fourth data block also includes steps S121 to S123:
[0152] Step S121, performing anti-jitter processing on the second data block to obtain a third data block;
[0153] In this embodiment, the second data block may be subjected to anti-jitter processing by a jitter buffer to obtain a third data block.
[0154] Among them, Jitter Buffer is a buffer mechanism commonly used in network communications, especially in real-time audio and video transmission. Jitter Buffer is a buffer used to cache and process real-time audio and video data. Its main function is to store and reorder received data packets to eliminate jitter and delay in network transmission, thereby ensuring the continuity of audio streams.
[0155] Step S122, performing deinterleaving processing on the third data block and marking the lost data block;
[0156] In this embodiment, it is assumed that during the transmission process, there is a packet loss rate of 60%, and some data packets are randomly lost.
[0157] The received packets are first deinterleaved to restore the original order and the lost packets are marked.
[0158] In the fourth embodiment of the present application, the interleaving process of the first data block can be regarded as swapping the rows and columns of the first data block matrix to obtain the second data block. Therefore, the deinterleaving process of the third data block in the embodiment of the present application can again swap the rows and columns of the third data block matrix.
[0159] Step S123: Based on the third data block, restore the lost data block by using an interpolation algorithm to obtain the fourth data block.
[0160] In this embodiment, a linear interpolation method is adopted, that is, linear interpolation is performed using adjacent data blocks.
[0161] For each missing data block, we will use the adjacent data blocks for linear interpolation. The basic formula for linear interpolation is:
[0162]
[0163] The missing data blocks are estimated through an interpolation algorithm and filled back into the original audio stream.
[0164] The following is a specific interpolation example: (interpolation of A2 / B1)
[0165]
[0166] After interpolation, the missing data blocks in the audio stream are filled with estimated values, such as Figure 5 As shown, Figure 5 This is a schematic diagram of the sequence after interpolation and recovery of data blocks in the audio transmission method of the present application.
[0167] At this time, although some data blocks are still lost, since this embodiment uses the interpolation method to restore most of the data, the audio quality will be significantly improved.
[0168] The embodiment of the present application improves the restoration quality of complex audio signals by optimizing the interpolation algorithm and combining the spectrum feature information, thereby maintaining the continuity and high quality of the audio. In addition, the embodiment of the present application dynamically adjusts the anti-packet loss strategy, optimizes audio transmission in real time according to network conditions, improves the system's adaptive ability, and ensures stable transmission in different network environments.
[0169] Based on the fifth embodiment of the present application, in the seventh embodiment of the present application, the same or similar contents as those in the fifth embodiment can be referred to the above description, and will not be described in detail later. On this basis, step S130, after reconstructing the audio based on the fourth data block, obtaining the reconstructed digital audio signal, further includes steps S140 to S160:
[0170] Step S140, decoding the digital audio signal according to the audio coding format to obtain a decoded digital audio signal;
[0171] Audio coding is a compression process to reduce the size of audio data for easy storage and transmission. Decoding is the reverse operation of this process, which uses the same algorithm or format information as encoding to restore the original digital audio signal. The decoded signal still remains in digital form, but any redundancy or distortion introduced during the compression process has been removed.
[0172] Step S150, converting the decoded digital audio signal into an analog audio signal through PCM pulse code modulation;
[0173] In this process, each sampling point of the digital audio signal is converted into a corresponding analog voltage or current value, which changes over time to simulate the waveform of the original sound.
[0174] Step S160: output the analog audio signal to a speaker for playback via a sound driver.
[0175] The driver receives the analog audio signal and converts it into a format that the speaker can understand, thereby driving the speaker to vibrate and produce sound.
[0176] The embodiments of the present application constitute a complete process from digital audio signals to analog audio output, ensuring the decoding, conversion and real-time playback of audio data, thereby providing a high-quality audio experience.
[0177] To further understand the above embodiments, please refer to Figure 6 , Figure 6 A schematic diagram of the process of audio transmission according to the audio transmission method of the present application.
[0178] like Figure 6 As shown in FIG. 1 , the present application designs an interleaving + interpolation anti-packet loss solution that can still restore the audio stream under a 60% packet loss rate, which requires combining data block interleaving and interpolation algorithms. The process of audio transmission is as follows Figure 6 , the total time of audio transmission is: [total time] = [time of audio sending process] + [time of audio receiving process], that is, Tsum-time = Send(P0+P1+P4+P3+P4)+Recv(P5+P6+P7+P8+P9).
[0179] Among them, P0 is the time given by the driver for acquisition, P1 is the time obtained from alsa, P2 is the time for audio encoding, P3 is the time for interleaving processing, P4 is the time for smoothing in the sending process, P5 is the time received after transmission through the network, P6 is the time for interpolation recovery / anti-jitter / audio reconstruction and other processing, P7 is the time for audio decoding, P8 is the time when the PCM stream is given to alsa, and P9 is the time for the driver to write to the physical device.
[0180] To further understand the above embodiments, please refer to Figure 7 , Figure 7 A schematic diagram comparing the audio transmission method of the present application with the prior art.
[0181] like Figure 7 As shown in the figure, the current status of real-time audio transmission is that most real-time audio transmission systems mainly rely on RTP (Real-time Transport Protocol) and UDP (User Datagram Protocol). These protocols will significantly reduce the audio quality in poor network environments, such as high packet loss rate or network fluctuations. The existing technology relies on retransmission and simple packet loss concealment technology for packet loss processing; the audio recovery quality of the existing technology is average, especially when processing complex audio signals; the retransmission mechanism used in the existing technology will cause high latency; the network adaptability of the existing technology is poor, especially when the network fluctuates greatly; the system resource occupancy rate of the existing technology is high, and the complex algorithm leads to large resource consumption.
[0182] The present application adopts data interleaving, optimized interpolation algorithm and dynamic anti-packet loss strategy for packet loss processing; the audio recovery quality of the present application is high, and the recovery quality is significantly improved by using the spectrum feature interpolation algorithm; the delay of the present application is significantly reduced through forward error correction and packet loss concealment technology; the present application can adapt to different network environments; the present application can optimize resource utilization and is suitable for embedded devices.
[0183] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the audio transmission method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0184] This application also provides an audio transmission device, please refer to Figure 8 , the audio transmission device is arranged at the first terminal, and includes:
[0185] A signal acquisition module 10, used to acquire a digital audio signal;
[0186] The encoding module 20 is used to encode the digital audio signal according to a preset audio encoding format to obtain an encoded digital audio signal;
[0187] A block division module 30, configured to divide the encoded digital audio signal into blocks to obtain a first data block;
[0188] An interleaving processing module 40, configured to perform an interleaving process on the first data block to obtain a second data block;
[0189] The sending module 50 is used to send the second data block to the second terminal, so that the second terminal recovers the second data block to obtain a fourth data block, and reconstructs the audio based on the fourth data block to obtain a reconstructed digital audio signal.
[0190] The audio transmission device provided by the present application adopts the audio transmission method in the above embodiment, which can solve the technical problem that the current audio transmission method adopts a retransmission mechanism to cause high delay. Compared with the prior art, the beneficial effects of the audio transmission device provided by the present application are the same as the beneficial effects of the audio transmission method provided by the above embodiment, and other technical features in the audio transmission device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0191] The present application provides an audio transmission device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the audio transmission method in the above-mentioned embodiment 1.
[0192] Reference below Fig. 9 , which shows a schematic diagram of the structure of an audio transmission device suitable for implementing the embodiment of the present application. The audio transmission device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The audio transmission device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0193] like Fig. 9As shown, the audio transmission device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the audio transmission device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the audio transmission device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an audio transmission device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0194] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0195] The audio transmission device provided by the present application adopts the audio transmission method in the above embodiment, which can solve the technical problem that the current audio transmission method adopts a retransmission mechanism to cause high delay. Compared with the prior art, the beneficial effects of the audio transmission device provided by the present application are the same as the beneficial effects of the audio transmission method provided by the above embodiment, and other technical features in the audio transmission device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.
[0196] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0197] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0198] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the audio transmission method in the above-mentioned embodiment.
[0199] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0200] The computer-readable storage medium may be included in the audio transmission device; or may exist independently without being assembled into the audio transmission device.
[0201] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the audio transmission device, the audio transmission device: obtains a digital audio signal; encodes the digital audio signal according to a preset audio coding format to obtain an encoded digital audio signal; divides the encoded digital audio signal into blocks to obtain a first data block; interleaves the first data block to obtain a second data block; sends the second data block to a second terminal so that the second terminal recovers the second data block to obtain a fourth data block, and reconstructs audio based on the fourth data block to obtain a reconstructed digital audio signal.
[0202] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0203] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0204] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0205] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned audio transmission method, and can solve the technical problem that the current audio transmission method adopts a retransmission mechanism to cause high delay. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the audio transmission method provided by the above-mentioned embodiment, and will not be repeated here.
[0206] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. An audio transmission method, characterized in that: Applied to a first terminal, the method includes: Acquire digital audio signal; Encoding the digital audio signal according to a preset audio encoding format to obtain an encoded digital audio signal; Divide the encoded digital audio signal into blocks to obtain a first data block; Performing interleaving processing on the first data block to obtain a second data block; The second data block is sent to the second terminal so that the second terminal recovers the second data block to obtain a fourth data block, and audio is reconstructed based on the fourth data block to obtain a reconstructed digital audio signal.
2. The method according to claim 1, characterized in that The step of acquiring the digital audio signal comprises: Collect analog audio signals from microphones via sound drivers; The analog audio signal is converted into the digital audio signal through PCM pulse code modulation.
3. The method according to claim 1, characterized in that Before the step of interleaving the first data block to obtain the second data block, the following steps are included: Performing real-time transport protocol encapsulation on the first data block to obtain a first data block carrying a real-time transport protocol message extension header; The step of performing interleaving processing on the first data block to obtain the second data block comprises: Interleaving is performed on the first data block carrying the real-time transport protocol message extension header to obtain the second data block.
4. The method according to claim 1, characterized in that The step of dividing the encoded digital audio signal into blocks to obtain a first data block comprises: Divide the encoded digital audio signal into blocks based on a preset time interval to obtain the first data block; The step of performing interleaving processing on the first data block to obtain the second data block comprises: A preset number of first data blocks are divided into a group for interleaving to obtain the second data blocks.
5. An audio transmission method, characterized in that: Applied to the second terminal, the method includes: receiving a second data block sent by a first terminal, where the second data block is obtained by encoding the digital audio signal according to a preset audio coding format by the first terminal after the first terminal acquires the digital audio signal, obtaining an encoded digital audio signal, dividing the encoded digital audio signal into blocks to obtain a first data block, and performing interleaving processing on the first data block; Restoring the second data block to obtain a fourth data block; Audio reconstruction is performed based on the fourth data block to obtain a reconstructed digital audio signal.
6. The method according to claim 5, characterized in that The step of recovering the second data block to obtain the fourth data block comprises: Performing anti-jitter processing on the second data block to obtain a third data block; Deinterleaving the third data block and marking the lost data block; Based on the third data block, the lost data block is restored by an interpolation algorithm to obtain the fourth data block.
7. The method according to claim 5, characterized in that After the step of performing audio reconstruction based on the fourth data block to obtain a reconstructed digital audio signal, the following steps are included: Decoding the digital audio signal according to the audio coding format to obtain a decoded digital audio signal; Converting the decoded digital audio signal into an analog audio signal by PCM pulse code modulation; The analog audio signal is output to a speaker for playing through a sound driver.
8. An audio transmission device, characterized in that: Set at the first terminal, the device includes: A signal acquisition module, used for acquiring a digital audio signal; An encoding module, used to encode the digital audio signal according to a preset audio encoding format to obtain an encoded digital audio signal; A block division module, used for dividing the encoded digital audio signal into blocks to obtain a first data block; An interleaving processing module, configured to perform an interleaving process on the first data block to obtain a second data block; The sending module is used to send the second data block to the second terminal, so that the second terminal recovers the second data block to obtain a fourth data block, and reconstructs the audio based on the fourth data block to obtain a reconstructed digital audio signal.
9. An audio transmission device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the audio transmission method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the audio transmission method according to any one of claims 1 to 7 are implemented.