Method for dynamic audio frame reconstruction and audio quality analysis

By sorting audio data packets and recovering from packet loss, the problem of incorrect data sequence in audio transmission is solved, ensuring the integrity of audio frames and the normal operation of speakers, providing a better audio quality experience.

CN119323975BActive Publication Date: 2025-09-23SHENZHEN SOUND SOURCE ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411572243.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-09-23
Estimated Expiration
2044-11-06

AI Technical Summary

Technical Problem

During audio transmission, the received audio data may be in the wrong order due to weak network signals and other reasons. The speaker cannot correctly compose audio frames, resulting in audio quality damage and malfunction. Existing technologies cannot effectively solve this problem.

Method used

By receiving the audio data packets to be detected, sorting and judging the audio data, recovering the lost packet data, and generating a lossless audio signal, the integrity of the audio frame and the normal operation of the speaker are ensured.

Benefits of technology

This ensures that audio data packets can be correctly sorted even under poor network conditions, ensuring the integrity of audio frames and the audio quality of the speakers, providing a better audio quality experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119323975B_ABST
    Figure CN119323975B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for dynamic audio frame reorganization and audio quality analysis. The method receives an audio data packet to be tested, sorts the audio data, determines whether the audio data packet has packet loss, and recovers the lost data if so. Simultaneously, the method determines the audio frame type of the audio data packet that has not been lost, and determines the audio signal generated by the output undamaged audio frame. If the audio data packet to be tested is an interfered audio frame or a damaged audio frame, no audio signal is generated, thereby ensuring the normal operation of vocal equipment and providing consumers with a better audio quality experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of loudspeaker signal processing, and in particular relates to a method for dynamic audio frame reorganization and audio quality analysis. Background Art

[0002] In recent years, with the popularization of broadband and the rapid development of network technology, speaker audio services are no longer limited to traditional broadcasting services, but have gradually expanded to various areas of life, such as entertainment activities such as audio and video on demand, as well as various emerging audio services formed on the Internet and mobile terminals. In order to provide high-quality audio signals, each audio frame needs to be divided into multiple data packets for wireless transmission during the audio transmission process. However, due to reasons such as weak network signals, the received audio data may sometimes be out of sequence, which prevents the speaker from correctly composing audio frames, causing the speaker to malfunction. Real-time monitoring of audio frames to determine whether there is any sound quality damage, while meeting audio quality requirements, to provide consumers with a better audio quality experience, is a technical problem that needs to be solved urgently. Summary of the Invention

[0003] In response to the above-mentioned shortcomings, the present invention solves the technical problem of providing a method for dynamic audio frame reassembly and audio quality analysis. The method receives audio data packets to be tested, sorts the audio data, determines whether the audio data packets have been lost, and if so, recovers the lost data. Furthermore, the method determines the audio frame type of the audio data packets that have not been lost, and determines the audio signal generated by the output undamaged audio frames. This method ensures the normal operation of vocal equipment and provides consumers with a better audio quality experience.

[0004] A first aspect of the present invention provides a method for dynamic reorganization of audio frames and audio quality analysis, characterized in that the method includes: S101: receiving an audio data packet to be detected, and sorting the audio data in the audio data packet to be detected, and encapsulating it into a first audio data packet.

[0005] S102: Receive the first audio data packet, re-sort the second audio data packet into a second audio data packet, determine whether the second audio data packet is lost, and if so, recover the lost data.

[0006] S103: Determine the type of audio frames in the audio data packets that have not been lost; if the audio frames in the audio data packets that have not been lost are intact audio frames, output the data packets to be detected and generate an audio signal; if the audio frames in the audio data packets that have not been lost are interfered audio frames or damaged audio frames, the data packets to be detected do not meet the playback requirements and no audio signal is generated.

[0007] According to one embodiment of the present invention, each sub-audio data packet D in the audio data packet to be detected i The audio frames include at least two audio frames, namely a first audio sample and a second audio sample, wherein the first audio sample and the second audio sample respectively include: frame header information F head , frame body information F body and frame end information F ta il, the frame header information F head Includes: the serial number SN of the audio sample i , encoding format, sampling rate, bit rate and number of channels.

[0008] According to one embodiment of the present invention, the audio data in the audio data packet P to be detected is sorted and encapsulated into a first audio data packet P′ in S101, including: sorting the audio data packet to be detected according to a reorganization function SortPackets(), wherein the reorganization function is shown in formula (1):

[0009] SortPackets(P)=P′ Formula (1)

[0010] Where P = {D1, D2, ..., D n} represents the set of received audio data packets to be detected, P′={D1′, D2′, ..., D n '} represents a first audio data packet set;

[0011] According to the serial number SN i Determine each sub-audio data packet D i The order is as shown in formula (2):

[0012] j = argmin 1≤k≤n |SN k -SN i Formula (2)

[0013] Where j represents the audio data packet D i The position where the packet should be inserted, where n is the number of packets currently received.

[0014] According to an embodiment of the present invention, the step S102 of receiving the first audio data packet and re-sorting the second audio data packet into a second audio data packet includes: i Sort by.

[0015] According to an embodiment of the present invention, the step S102 of determining whether the second audio data packet is lost includes: i Judgment, including:

[0016] Determine the serial number SNi Is it continuous? For example, whether formula (3) holds for all audio samples:

[0017] SN i+1 =SN i +1 Formula (3)

[0018] If the first audio sample and the second audio sample in the second audio data packet satisfy equation (3), then there is no packet loss in the sub-audio data packet in the second audio data packet;

[0019] If the second audio data packet contains the first audio sample and the second audio sample that do not satisfy equation (3), then the sub-audio data packet in the second audio data packet is lost.

[0020] According to one embodiment of the present invention, if packet loss occurs in S102, recovering the lost packet data includes:

[0021] Calculate the serial number of the missing audio sample as shown in formula (4):

[0022] Missing SNs={SN i+1 -SN i >1|i∈[1,n-1]} Formula (4)

[0023] Among them, SN i+1 Represents the second audio sample, SN i represents the first audio sample;

[0024] Calculate the number of packet losses according to formula (5):

[0025]

[0026] in, Represents an indicator function, if the condition is true, the result is 1, otherwise 0;

[0027] The missing audio data is calculated by linear interpolation method, as shown in formula (6):

[0028]

[0029] P est (i) represents the i-th lost audio data packet, P prev Indicates loss of P est (i) The last received audio data packet before, P next Indicates loss of P est (i) The first received audio data packet after SN(P est (i) indicates the lost audio data packet P est (i) Serial number, SN(Pprev ) and SN(P next ) represent P est (i) Sequence numbers of adjacent packets.

[0030] According to one embodiment of the present invention, determining the type of the audio frame in the non-lost data packet in S103 includes: determining the type of the audio frame according to the frame header information of the non-lost audio frame, as shown in formula (7):

[0031] T=f type (B) Formula (7)

[0032] Among them, B is the frame header information, and T is the audio frame type.

[0033] The second aspect of the present invention provides an intelligent device, including a transmitter, a receiver, a memory and a processor; the memory is used to store computer instructions; the processor is used to run the computer instructions stored in the memory to implement the above-mentioned method for dynamic reconstruction of audio frames and audio quality analysis.

[0034] A third aspect of the present invention provides a storage medium comprising: a readable storage medium and computer instructions, wherein the computer instructions are stored in the readable storage medium; the computer instructions are used to implement the above-mentioned method for dynamic reorganization of audio frames and audio quality analysis.

[0035] The present invention provides the following beneficial effects: By sorting audio data packets twice, the audio data packets can be correctly sorted by sequence number even when poor network conditions cause data packets to be out of order, thereby ensuring the integrity of the audio frames and the audio quality played by the speakers. At the same time, by matching paired audio frames and determining whether the audio data packets have been lost by sequence number, the normal operation of the equipment is guaranteed, while ensuring the complete recovery of audio data and providing consumers with better audio quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0037] Figure 1 This is a flow chart of a method for dynamic audio frame reorganization and audio quality analysis disclosed in an embodiment of the present invention.

[0038] The above drawings illustrate specific embodiments of the present disclosure, which will be described in more detail below. These drawings and textual descriptions are not intended to limit the scope of the present disclosure in any way, but rather to illustrate the concepts of the present disclosure to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0039] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.

[0040] The first aspect of the present invention discloses a method for dynamic reorganization of audio frames and audio quality analysis, such as Figure 1 As shown, the method includes: S101: receiving an audio data packet to be detected, sorting the audio data in the audio data packet to be detected, and encapsulating the audio data into a first audio data packet. The audio data packet corresponds to at least two audio frames, and each audio data packet has a sequence number indicating the order of the audio data packet in the multiple audio data packets. The multiple audio data packets are sorted by a reassembly algorithm to generate a reordered data packet, and the reordered data packet is encapsulated as a data packet to be detected for transmission; (the reordered data packet is output to regenerate the at least two audio frames).

[0041] Each sub-audio data packet D in the audio data packet to be detected i The audio frames include at least two audio frames, namely a first audio sample and a second audio sample, wherein the first audio sample and the second audio sample respectively include: frame header information F head , frame body information F body and frame end information F tail , the frame header information F head Includes: the serial number SN of the audio sample i , encoding format, sampling rate, bit rate and number of channels.

[0042] The reassembly algorithm first needs to determine the structure of the audio frame, which typically consists of a frame header (containing information such as the frame sequence number), a frame body (containing the audio data), and a frame trailer (which may contain checksum information). During the reassembly process, the algorithm needs to be able to detect whether the data packets are out of order. Typically, the sequence number in the frame header can be used to determine the order of the frames, allowing the reassembly algorithm to accurately identify and correct out-of-order frames.

[0043] Specifically, receive audio data packets, each of which contains the following information: audio data packet D i , the sequence number (indicating its order) SN of the i-th audio data i , the i-th audio data packet corresponds to the frame header of the audio frame The frame body of the audio frame corresponding to the i-th audio data packet The i-th audio data packet corresponds to the end of the audio frame

[0044] Assuming that each audio frame is divided into two data packets, a complete audio frame consists of two data packets, denoted as D i and D i+1 .

[0045] Secondly, determine the audio structure, which can be expressed as formula (1):

[0046] F={F head ,F body ,F tail Formula (1)

[0047] Among them, F head Contains control information such as serial number SN, F body Contains the main audio data, F tail Contains calibration information.

[0048] Next, we detect and sort out-of-order packets and define a reassembly algorithm function SortPackets(), which receives an out-of-order packet set P and returns a sorted packet set P′, as shown in Equation (2).

[0049] SortPackets(P)=P′ Formula (2)

[0050] Where P = {D1, D2, ..., D n} represents the set of received data packets, P′={D1′, D2′, ..., D n ′} represents the sorted data packet set.

[0051] Use serial number SN i Determine the order of data packets. The specific order can be expressed by the following mathematical formula (3):

[0052] j = argmin 1≤k≤n |SN k -SN i Formula (3)

[0053] Where j represents the audio data packet D i The position where the packet should be inserted, where n is the number of packets currently received.

[0054] Assume that four out-of-order data packets P={D1, D2, D3, D4} are received, and their sequence numbers are SN1=3, SN2=1, SN3=4, and SN4=2 respectively.

[0055] For D1, find the correct position in P', that is, find the sequence number closest to SN1, which is SN2, so D1 should be sorted after D2. For D2, since it has the smallest sequence number, it should be sorted first. For D3, since it has the largest sequence number, it should be sorted last. For D4, it should be sorted between D1 and D3.

[0056] After the sorted data packet set P′={D2, D4, D1, D3} is sorted, the data packets are repackaged into detection data packets for the next step of quality detection.

[0057] The above steps ensure that even if the network condition is poor and the data packets are out of order, the audio data packets can be correctly sorted by sequence number, thereby ensuring the integrity of the audio frames and the audio quality played by the speakers.

[0058] Step S102: receiving the first audio data packet, re-sorting the second audio data packet into a second audio data packet, determining whether the second audio data packet is lost, and if so, recovering the lost data.

[0059] Real-time Transport Protocol (RTP) is used to transmit audio and video over IP networks. The following is the process of receiving audio packets:

[0060] Determine the RTP transport address (IP address and port number) for the audio stream. Use Socket programming to create a UDP socket and bind it to the specified IP address and port number. Start listening for audio packets from the sender.

[0061] Mathematical description is as follows:

[0062] Socket(IP,Port)→Listen() Formula (4)

[0063] In the formula, IP represents the IP address of the received data packet, and Port represents the port number of the received data packet.

[0064] Assume that the RTP transport address of the audio stream is 192.168.1.10:5000, then a socket will be created and listen on this address.

[0065] The frame header of the RTP data packet contains information such as the sequence number (SN), timestamp (T), and identification bit (M).

[0066] Read the data packet and read the first 12 bytes from the received data packet, which is the fixed header of RTP.

[0067] Extract information: extract the sequence number (2 bytes), timestamp (4 bytes), and identification bit (1 bit) from the header.

[0068] Mathematical description is as follows:

[0069] DataPacket→(SN,T,M) Formula (5)

[0070] SN is the sequence number used to identify the order of data packets. T is the timestamp, which indicates the sampling time of the audio frame in the data packet. M is the flag bit, which marks whether the current data packet is a key frame or an end frame.

[0071] Assume that an RTP data packet is received, and its header information is as follows:

[0072] Serial number: 0x1234 (hexadecimal), converted to decimal is 4660.

[0073] Timestamp: 0x00000ABC (hexadecimal), converted to decimal is 2748.

[0074] Identification bit: The second bit is 1, indicating that this is a key frame.

[0075] Sort the data packets and regenerate the audio signal. Sort all received data packets according to the sequence number SN.

[0076] Check whether the serial number is continuous. If the serial number is not missing, it complies with formula (6):

[0077] SN i+1 =SN i +1 Formula (6)

[0078] If this holds true for all sequence numbers, it is assumed that there is no packet loss.

[0079] If the sequence number is missing, as shown in formula (7):

[0080] MissingSNs={SN i+1 -SN i >1|i∈[1,n-1]} Formula (7)

[0081] Among them, SN i+1 Is the current serial number, SN i It is the previous serial number.

[0082] Calculate the number of lost packets based on the missing sequence numbers. Count the missing sequence numbers and determine the location of the lost packets based on the count value. The number of lost packets, L, is calculated using formula (8):

[0083]

[0084] in, Represents an indicator function, which returns 1 if the condition is true, otherwise 0.

[0085] When packet loss is detected, it attempts to recover the lost audio data by copying adjacent packets.

[0086] Assuming that each data packet contains k audio samples, we can use linear interpolation to estimate the content of the lost data packet, as shown in Equation (9):

[0087]

[0088] P est (i) represents the estimated i-th lost packet.

[0089] P prev Is the last received packet before the lost packet.

[0090] P next It is the first received packet after the lost packet.

[0091] SN(P est (i) is the sequence number of the lost packet. prev ) and SN(P next ) are the sequence numbers of adjacent data packets.

[0092] Suppose we have a sequence of 5 packets, numbered 1 to 5, and packet P3 is lost.

[0093] Before sorting: P = {P1, P2, P4, P5}

[0094] After sorting: P′={P1, P2, P4, P5} (already sorted)

[0095] Check for missing sequence numbers: missing_packets(P′) = {3}

[0096] Calculate the number of lost packets: N lost =|{3}|=1

[0097] Recover the lost audio data as shown in formula (10).

[0098]

[0099] In this way, we can attempt to recover lost packets, thus reducing interruptions and artifacts in audio playback.

[0100] If there is no packet loss, the sorted data packets are directly used to regenerate the audio signal.

[0101] Assume that a series of data packets are received with sequence numbers [4660, 4662, 4663, 4664]. Checking finds that the sequence numbers are continuous, so there is no packet loss, and these data packets can be directly used to reconstruct the audio signal.

[0102] Please note that the above processes and formulas are simplified examples. In actual applications, more complex error detection and recovery mechanisms may be required to handle problems such as packet loss and network delay.

[0103] S103: Determine the type of audio frames in the audio data packets that have not been lost; if the audio frames in the audio data packets that have not been lost are intact audio frames, output the data packets to be detected and generate an audio signal; if the audio frames in the audio data packets that have not been lost are interfered audio frames or damaged audio frames, the data packets to be detected do not meet the playback requirements and no audio signal is generated.

[0104] First, we need to analyze the frame header information of the unlost audio frame to determine the frame type. Assume we have a function f type (B), which receives the frame header information B and returns the frame type T, as shown in formula (11).

[0105] T=f type (B) Formula (11)

[0106] B is the frame header information, which contains frame metadata such as frame number and timestamp. T is the frame type, which can be "impaired audio frame", "interfered audio frame" or "innocent audio frame".

[0107] Using the frame types of adjacent audio frames Since audio signals have short-term correlation, we can use the types of adjacent frames to infer the type of the current frame. Let g pred (T prev ,T next ) is the prediction function, which is based on the previous frame type T prev and the next frame type T next To predict the type T of the current frame curr , as shown in formula (12).

[0108] T curr =g pred (T prev ,T next ) Formula (12)

[0109] By judging the frame type in the packet loss and the predicted frame type, we can determine which category the frame in the packet loss belongs to. Let h judge (T curr ,P) is the judgment function, where P is the packet loss situation and the output is J, as shown in formula (13).

[0110] J=h judge (Tcurr ,P) Formula (13)

[0111] Where J is the judgment result, which can be "damaged audio frame", "interfered audio frame" or "undamaged audio frame".

[0112] To process different types of frames, we adopt different processing methods according to the judgment results. If J is a "damage-free audio frame", the data packet to be detected is directly output to regenerate the audio signal, as shown in Equation (14).

[0113] A output =A detected ifJ = "lossless audio frame" Equation (14)

[0114] Among them, A output is the output audio signal, A detected It is the audio signal reassembled from the detected data packets.

[0115] If J is a "damaged audio frame" or a "disturbed audio frame", it needs to be further processed or marked, as shown in formula (15).

[0116] A flagged =f flag (A detected ,J) ifJ∈{"damaged audio frame","interfered audio frame"} Equation (15)

[0117] Among them, A flagged It is a marked audio signal, indicating that it does not meet the playback requirements. flag It is a marking function that receives the audio signal and frame type and performs corresponding processing.

[0118] Assume the frame sequence is known: frame 1 (no damage), frame 2 (packet loss), frame 3 (no damage)

[0119] Analyze the frame header information of frame 1 and frame 3 to obtain the type, as shown in formula (16) and formula (17):

[0120] T prev =f type (B1) = "lossless audio frame" Equation (16)

[0121] T next =f type (B3) = "lossless audio frame" Equation (17)

[0122] The type of predicted frame 2 is shown in formula (18):

[0123] T curr =g pred (T prev ,T next) = "lossless audio frame" Formula (18)

[0124] Determine the type of frame 2, as shown in formula (19):

[0125] J=h judge (T curr ,P)=“lossless audio frame” Formula (19)

[0126] According to the judgment result, the data packet to be detected is directly output to regenerate the audio signal, as shown in formula (20):

[0127] A output =A detected Formula (20)

[0128] Please note that the examples here are simplified. In practice, g pred () and h judge () and other functions will contain more complex logic and algorithms to more accurately predict and determine the frame type.

[0129] Calculate the packet loss location. Let the missing sequence number be SN missing .

[0130] Determine the current frame type based on the adjacent frame type. Let the current frame type be F current , the adjacent frame type is F 邻近 .

[0131] Determine the type of packet loss frame. The mathematical formulas are shown in Equations (21), (22), and (23):

[0132]

[0133] Assume SN = {1, 2, 4, 5, 6}, then SN missing ={3}.

[0134] If the adjacent frame F 邻近 = lossless audio frame, is_playable(F current )=1, data packets can be output.

[0135] The above processes and formulas are written in LaTeX format, which is compatible with Markdown. In your specific application, these steps and formulas can be adjusted and optimized according to actual needs.

[0136] The second aspect of the present invention provides an intelligent device, including a transmitter, a receiver, a memory and a processor; the memory is used to store computer instructions; the processor is used to run the computer instructions stored in the memory to implement the above-mentioned method for dynamic reconstruction of audio frames and audio quality analysis.

[0137] A third aspect of the present invention provides a storage medium comprising: a readable storage medium and computer instructions, wherein the computer instructions are stored in the readable storage medium; the computer instructions are used to implement the above-mentioned method for dynamic reorganization of audio frames and audio quality analysis.

[0138] The present invention provides the following beneficial effects: By sorting audio data packets twice, the audio data packets are correctly sorted by sequence number, even if poor network conditions cause data packets to be out of order, thereby ensuring the integrity of the audio frames and the audio quality played by the speakers. Furthermore, by matching paired audio frames and determining whether the audio data packets have been lost by sequence number, the normal operation of the equipment is guaranteed, while ensuring the complete recovery of audio data and providing better audio quality for consumers.

[0139] Obviously, the above specific implementation cases are merely examples for illustrating the application of the present method, and are not intended to limit the implementation methods. A person skilled in the art can make other variations and modifications based on the above description to study other related issues. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

[0140] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk, etc. Various media that can store program codes.

[0141] The embodiments of electronic devices and the like described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the embodiments. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0142] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the embodiments of the present invention have been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

[0144] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.

[0145] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for dynamic reorganization of audio frames and audio quality analysis, characterized in that: The method comprises: S101: receiving an audio data packet to be detected, sorting the audio data in the audio data packet to be detected, and encapsulating the audio data into a first audio data packet; S102: Receive the first audio data packet, re-sort the first audio data packet into a second audio data packet, determine whether the second audio data packet is lost, and if so, recover the lost data; S103: Determine whether the audio frame type in the audio data packet that has not been lost in the second audio data packet is a damage-free audio frame, an interfered audio frame, or a damaged audio frame; if the audio frame in the audio data packet that has not been lost is a damage-free audio frame, output the data packet to be detected and generate an audio signal; if the audio frame in the audio data packet that has not been lost is an interfered audio frame or a damaged audio frame, the data packet to be detected does not meet the playback requirements and no audio signal is generated.

2. The method according to claim 1, characterized in that The audio data packet to be detected includes a plurality of sub-audio data packets D i , each sub-audio data packet D i The audio frames include at least two audio frames, namely a first audio sample and a second audio sample, wherein the first audio sample and the second audio sample respectively include: frame header information F head , frame body information F body and frame end information F tail , the frame header information F head Includes: the serial number SN of the audio sample i , encoding format, sampling rate, bit rate and number of channels.

3. The method according to claim 2, characterized in that In the step S101, the audio data in the audio data packet to be detected P is sorted and encapsulated into a first audio data packet P′, including: sorting the audio data packet to be detected according to the reassembly function SortPackets(), and reassembling the audio data packet according to the sequence number SN of the sub-audio data packet. i Sorting in ascending order, the reorganization function is shown in formula (1): SortPackets(P)=P′ Formula (1) Where P = {D1, D2, ..., D n } represents the set of received audio data packets to be detected, P′={D1′, D2′, ..., D n '} represents a first audio data packet set; According to the serial number SN i Determine each sub-audio data packet D i The order is as shown in formula (2): j = argmin 1≤k≤n |SN k - SN i | Equation (2) Where j represents the audio data packet D i The position where the packet should be inserted, where n is the number of packets currently received.

4. The method according to claim 3, characterized in that The step S102 of receiving the first audio data packet and reordering the second audio data packet into a second audio data packet includes: i Sort.

5. The method according to claim 4, characterized in that The step S102 of determining whether the second audio data packet is lost includes: i Judgment, including: Determine the serial number SN i Is it continuous? For example, whether formula (3) holds for all audio samples: SN i+1 = SN i + 1 Equation (3) If the first audio sample and the second audio sample in the second audio data packet satisfy equation (3), then there is no packet loss in the sub-audio data packet in the second audio data packet; If the second audio data packet contains the first audio sample and the second audio sample that do not satisfy equation (3), then the sub-audio data packet in the second audio data packet is lost.

6. The method according to claim 5, characterized in that If there is packet loss in S102, the lost packet data is recovered, including: calculating the sequence number of the missing audio sample, as shown in formula (4): Missing SNs={SN i+1 -SN i >1|i∈[1,n-1]} Formula (4) Where, SN i+1 Represents the second audio sample, SN i represents the first audio sample; Calculate the number of packet losses according to formula (5): in, Represents an indicator function, if the condition is true, the result is 1, otherwise 0; The missing audio data is calculated by linear interpolation method, as shown in formula (6): P est (i) represents the i-th lost audio data packet, P prev Indicates loss of P est (i) The last received audio data packet before, P next Indicates loss of P est (i) The first received audio data packet after SN(P est (i)) indicates the lost audio data packet P est (i) Serial number, SN(P prev ) and SN(P next ) represent P est (i) Sequence numbers of adjacent packets.

7. The method according to claim 6, characterized in that The step S103 of determining the type of the audio frame in the non-lost data packet includes: determining the type of the audio frame according to the frame header information of the audio frame in the non-lost data packet, as shown in formula (7): T=f type (B) Formula (7) Among them, B is the frame header information, and T is the audio frame type.

8. A smart device, characterized in that: include: transmitter, receiver, memory, and processor; The memory is used to store computer instructions; the processor is used to execute the computer instructions stored in the memory to implement the method for dynamic reconstruction of audio frames and audio quality analysis according to any one of claims 1 to 7.

9. A storage medium, characterized in that: include: a readable storage medium and computer instructions, wherein the computer instructions are stored in the readable storage medium; The computer instructions are used to implement the method for dynamic audio frame reconstruction and audio quality analysis according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Digital Voice Packet Loss Concealment Using Deep Learning

    CN112751820A

  • RTP data packet out-of-order processing and frame recombination method and system

    CN113014586A