Audio transmission method and device based on wireless environment, equipment and storage medium

By employing a multi-dimensional channel quality scoring mechanism and a dynamic transmission strategy, the continuity and sound quality stability issues of wireless audio transmission systems in dynamic channel environments are resolved, achieving efficient audio transmission in dynamic channels.

CN122268853BActive Publication Date: 2026-07-31LINKPLAY TECHNOLOGY INC NANJING
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LINKPLAY TECHNOLOGY INC NANJING
Filing Date
2026-05-26
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing wireless audio transmission systems struggle to balance continuity, low latency, and stable audio quality in dynamic channel environments, primarily because single channel quality assessment metrics and fixed transmission strategies cannot adapt to dynamic changes in channel quality.

Method used

A multi-dimensional channel quality parameter scoring mechanism is adopted, including received signal strength indication, packet loss rate, round-trip time delay and jitter. The transmission mode level, playback layer target depth and retransmission time window are dynamically adjusted, and the encoding format is switched at the audio frame boundary. Combined with forward error correction and negative acknowledgment retransmission, the mechanism is integrated.

Benefits of technology

In dynamic channel environments, it significantly improves the continuity, real-time performance, and sound quality stability of audio transmission, avoiding stuttering when the channel deteriorates and unnecessary delays when the channel is good, thus improving the system's adaptability and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122268853B_ABST
    Figure CN122268853B_ABST
Patent Text Reader

Abstract

This invention relates to the field of audio transmission technology, and discloses an audio transmission method, apparatus, device, and storage medium based on a wireless environment, for improving the continuity and sound quality stability of audio transmission. The audio transmission method based on a wireless environment includes: obtaining and scoring multi-dimensional channel quality parameters to determine the transmission mode level and corresponding playback layer target depth; adjusting the transmission rate and determining the retransmission time window based on buffer occupancy; switching the encoding format at audio frame boundaries; and coordinating forward error correction and negative acknowledgment retransmission within the window when data packets are lost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of audio transmission technology, and in particular to an audio transmission method, apparatus, device, and storage medium based on a wireless environment. Background Technology

[0002] Current mainstream wireless audio transmission systems typically employ fixed or single-dimensional channel quality assessment strategies, such as adjusting transmission parameters solely based on received signal strength or packet loss rate, and using fixed playback buffer depth for packet loss recovery. However, wireless channel quality dynamically changes due to various factors such as signal attenuation, multipath interference, network congestion, and device movement, making single-parameter or fixed strategies unsuitable for universal application. In scenarios with poor channel quality, relying solely on signal strength while ignoring round-trip latency and jitter can lead to playback buffer underloading causing frequent stuttering, or retransmission requests exceeding the available time window resulting in invalid retransmissions and further exacerbating latency. Conversely, in scenarios with good channel quality, using conservative encoding formats and excessively deep playback buffers introduces unnecessary end-to-end latency, reducing the real-time interactive experience. Therefore, existing wireless audio transmission methods struggle to simultaneously achieve continuity, low latency, and stable audio quality in dynamic channel environments. Summary of the Invention

[0003] This invention provides an audio transmission method, apparatus, device, and storage medium based on a wireless environment to solve the problems of audio playback stuttering, increased latency, and unstable sound quality caused by the inability of a single channel quality assessment index and fixed transmission strategy to adapt to dynamic wireless channel changes in the prior art.

[0004] The first aspect of this invention provides an audio transmission method based on a wireless environment, comprising: acquiring multi-dimensional channel quality parameters of a wireless link, the multi-dimensional channel quality parameters including received signal strength indication, packet loss rate, round-trip time, and jitter; performing scoring calculation processing based on the multi-dimensional channel quality parameters to obtain a target link quality score; determining a target transmission mode level based on the target link quality score; determining a corresponding playback layer target depth based on the target transmission mode level; adjusting the transmission rate based on a comparison between the actual occupancy rate of the current playback layer buffer and the playback layer target depth, and determining a time window available for retransmission; performing encoding format switching processing at audio frame boundaries based on the difference between the target transmission mode level and the current transmission mode level; and performing coordinated processing of forward error correction and negative acknowledgment retransmission within the time window when data packet loss is detected.

[0005] In one feasible implementation, obtaining the multi-dimensional channel quality parameters of the wireless link includes: periodically collecting received signal strength indications through the wireless communication module; calculating the packet loss rate through packet sequence number detection and repetition calculation; measuring round-trip delay through a timestamp mechanism; calculating jitter through the variance of the arrival time interval of adjacent data packets; and encapsulating the received signal strength indications, the packet loss rate, the round-trip delay, and the jitter to obtain the multi-dimensional channel quality parameters.

[0006] In one feasible implementation, the step of calculating the target link quality score based on the multi-dimensional channel quality parameters includes: mapping the received signal strength indicator, the packet loss rate, the round-trip time, and the jitter to a unified scoring interval to obtain sub-scores for each dimension; selecting a set of weighting coefficients from a preset weighting coefficient mapping table based on the service type identifier of the current audio session, wherein the service type identifier includes real-time interactive type, streaming media playback type, and default type, different service types correspond to different weighting coefficient configurations, and the sum of the weighting coefficients corresponding to the received signal strength indicator, the packet loss rate, the round-trip time, and the jitter is 1; and performing a weighted summation calculation on each dimension sub-score and its corresponding weighting coefficient to obtain the target link quality score.

[0007] In one feasible implementation, determining the target transmission mode level based on the target link quality score includes: pre-dividing multiple consecutive link quality score intervals and configuring a transmission mode level corresponding to each score interval, wherein the transmission mode levels include high-speed low redundancy mode, balanced adaptation mode, anti-interference high redundancy mode, and deep coverage keep-alive mode; matching and comparing the target link quality score with each link quality score interval to determine the target score interval in which the target link quality score is located; outputting the transmission mode level corresponding to the target score interval as the target transmission mode level, and simultaneously acquiring the preset encoding format, forward error correction redundancy rate, and retransmission timeout configuration parameters under the transmission mode level.

[0008] In one feasible implementation, determining the corresponding playback layer target depth based on the target transmission mode level includes: obtaining a mapping table between transmission mode levels and playback layer target depths, wherein the lower the transmission mode level, the greater the corresponding playback layer target depth; querying the mapping table according to the target transmission mode level to obtain a baseline target depth value corresponding to the target transmission mode level; and dynamically correcting the baseline target depth value according to the historical jitter trend of the wireless link to obtain the playback layer target depth.

[0009] In one feasible implementation, the step of dynamically correcting the baseline target depth value based on the historical jitter trend of the wireless link to obtain the playback layer target depth includes: collecting the most recent M jitter values ​​to form a jitter history sequence, calculating the mean and standard deviation of the jitter sequence; determining a depth correction coefficient based on the mean and the standard deviation, wherein the larger the jitter, the larger the correction coefficient; and multiplying the baseline target depth value by the depth correction coefficient to obtain the playback layer target depth.

[0010] In one feasible implementation, adjusting the transmission rate and determining the available retransmission time window based on the comparison between the actual occupancy rate of the current playback layer buffer and the target depth of the playback layer includes: real-time monitoring of the actual occupancy rate of the current playback layer buffer and calculating the deviation between the actual occupancy rate and the target depth of the playback layer; when the deviation is greater than a preset first threshold, determining that the buffer occupancy is too high and performing an operation to reduce the transmission rate; when the deviation is less than a preset second threshold, determining that the buffer occupancy is too low and performing an operation to increase the transmission rate, wherein the preset first threshold is greater than the preset second threshold; when the deviation is within the range between the preset first threshold and the preset second threshold, maintaining the current transmission rate unchanged and calculating the maximum tolerable retransmission delay based on the current occupancy level of the playback layer buffer; comparing the maximum tolerable retransmission delay with the round-trip delay of the current wireless link and taking the smaller of the two as the length of the available retransmission time window; updating the start time of the time window to the time when the most recent data packet transmission was completed, and when a retransmission request is initiated, only data packets that have not yet timed out within the time window are allowed to perform retransmission operations.

[0011] In one feasible implementation, the real-time monitoring of the actual occupancy rate of the current playback layer buffer and the calculation of the deviation between the actual occupancy rate and the target depth of the playback layer include: at the arrival of each audio frame cycle, reading the amount of stored data in the current playback layer buffer and dividing the amount of stored data by the total capacity of the buffer to obtain the actual occupancy rate; subtracting a preset target depth of the playback layer from the actual occupancy rate to obtain an initial deviation value, wherein the target depth of the playback layer is represented as a percentage of the total capacity of the buffer; performing low-pass filtering on the initial deviation values ​​obtained for multiple consecutive cycles to filter out instantaneous fluctuation noise, and using the filtered value as the final deviation value.

[0012] In one feasible implementation, the step of performing encoding format switching processing at the audio frame boundary based on the difference between the target transmission mode level and the current transmission mode level includes: comparing the target transmission mode level and the current transmission mode level, determining the switching direction and level difference, and after the transmitting end waits for the current audio frame to be fully encoded and transmitted, inserting a switching alignment flag carrying the target encoding format parameters at the boundary of the adjacent audio frame; after the receiving end detects the switching alignment flag, suspending the current decoder state and initializing the new decoder corresponding to the target encoding format; during the switching between the old and new decoders, performing crossfade smooth transition processing on the audio output buffer, and after the switching is completed, the transmitting end and the receiving end synchronously confirm and clear the switching alignment flag.

[0013] In one feasible implementation, the step of performing coordinated forward error correction and negative acknowledgment retransmission within the time window when data packet loss is detected includes: after the receiving end detects data packet loss, it determines whether the lost data packet falls within the forward error correction protection range; if it falls within the forward error correction protection range, it attempts to recover the lost data packet based on the received redundant packets; if the recovery is successful, no retransmission request is sent; if the recovery fails, a negative acknowledgment retransmission request is generated and the sequence number and timestamp of the lost data packet are recorded; if it does not fall within the forward error correction protection range, a negative acknowledgment retransmission request is directly generated and the sequence number and timestamp of the lost data packet are recorded; the delay difference between the current time and the original transmission time of the lost packet is calculated, and it is determined whether the difference is less than or equal to the length of the available retransmission time window: if it is within the window, a negative acknowledgment retransmission request is allowed to be sent; otherwise, retransmission is abandoned and audio frame loss concealment processing is triggered; when there are multiple lost data packets within the time window, the negative acknowledgment retransmission requests are sorted and sent according to the importance priority of the data packets, and the data packets corresponding to the key audio frames are retransmitted first.

[0014] In one feasible implementation, determining whether a lost data packet falls within the scope of forward error correction protection includes: parsing the header of the lost data packet, extracting the audio frame sequence number and packet type identifier to which the lost data packet belongs, wherein the packet type identifier is used to distinguish between the original audio data packet and forward error correction redundant packets; querying the forward error correction coding parameters cached locally based on the audio frame sequence number to determine whether forward error correction protection is enabled for the audio frame, as well as the number of forward error correction redundant packets and the redundant packet index range used; if forward error correction protection is enabled for the audio frame, and the number of currently received redundant packets meets the recovery conditions, then the lost data packet is determined to fall within the scope of forward error correction protection; otherwise, it is determined not to fall within the scope of forward error correction protection.

[0015] In one feasible implementation, the step of prioritizing the sending of negative acknowledgment retransmission requests according to the importance of data packets, and prioritizing the retransmission of data packets corresponding to key audio frames, includes: dividing data packets into three priority levels: I-frame packets, P-frame packets, and non-key frame packets, where I-frame packets have the highest retransmission priority, P-frame packets have the medium retransmission priority, and non-key frame packets have the lowest retransmission priority; when multiple data packets are lost within the time window, the negative acknowledgment retransmission requests are sorted from highest to lowest priority, with retransmission requests for I-frame packets being sent first; when the remaining length of the time window is less than a preset threshold, only the highest priority I-frame packets are allowed to initiate retransmission requests, while retransmission requests for P-frame packets and non-key frame packets are suppressed.

[0016] A second aspect of the present invention provides an audio transmission device based on a wireless environment, comprising: an acquisition module for acquiring multi-dimensional channel quality parameters of a wireless link, the multi-dimensional channel quality parameters including received signal strength indication, packet loss rate, round-trip time, and jitter; a calculation module for performing scoring calculation processing based on the multi-dimensional channel quality parameters to obtain a target link quality score; a first determination module for determining a target transmission mode level based on the target link quality score; a second determination module for determining a corresponding playback layer target depth based on the target transmission mode level; a first processing module for adjusting the transmission rate and determining a retransmission available time window based on a comparison between the actual occupancy rate of the current playback layer buffer and the playback layer target depth; a second processing module for performing encoding format switching processing at audio frame boundaries based on the difference between the target transmission mode level and the current transmission mode level; and a third processing module for performing coordinated processing of forward error correction and negative acknowledgment retransmission within the time window when data packet loss is detected.

[0017] In one feasible implementation, the acquisition module is specifically used to: periodically collect received signal strength indications through the wireless communication module; calculate the packet loss rate through data packet sequence number detection and repetition calculation; measure round-trip delay through a timestamp mechanism; calculate jitter through the variance of the arrival time interval of adjacent data packets; and encapsulate the received signal strength indications, the packet loss rate, the round-trip delay, and the jitter to obtain multi-dimensional channel quality parameters.

[0018] In one feasible implementation, the calculation module is specifically used to: map the received signal strength indicator, the packet loss rate, the round-trip time, and the jitter to a unified scoring interval to obtain sub-scores for each dimension; select a set of weighting coefficients from a preset weighting coefficient mapping table according to the service type identifier of the current audio session, wherein the service type identifier includes real-time interactive type, streaming media playback type, and default type, different service types correspond to different weighting coefficient configurations, and the sum of the weighting coefficients corresponding to the received signal strength indicator, the packet loss rate, the round-trip time, and the jitter is 1; and perform a weighted summation calculation on each dimension sub-score and its corresponding weighting coefficient to obtain the target link quality score.

[0019] In one feasible implementation, the first determining module is specifically used to: pre-divide multiple consecutive link quality score intervals, and configure a transmission mode level for each score interval, wherein the transmission mode level includes high-speed low redundancy mode, balanced adaptation mode, anti-interference high redundancy mode, and deep coverage keep-alive mode; match and compare the target link quality score with each link quality score interval to determine the target score interval in which the target link quality score is located; output the transmission mode level corresponding to the target score interval as the target transmission mode level, and simultaneously obtain the preset encoding format, forward error correction redundancy rate, and retransmission timeout configuration parameters under the transmission mode level.

[0020] In one feasible implementation, the second determining module includes: a first acquisition unit, configured to acquire a mapping table between transmission mode level and playback layer target depth, wherein the lower the transmission mode level, the greater the corresponding playback layer target depth; a second acquisition unit, configured to query the mapping table according to the target transmission mode level to acquire a baseline target depth value corresponding to the target transmission mode level; and a correction unit, configured to dynamically correct the baseline target depth value according to the historical jitter trend of the wireless link to obtain the playback layer target depth.

[0021] In one feasible implementation, the correction unit is specifically used to: collect the most recent M jitter values ​​to form a jitter history sequence, calculate the mean and standard deviation of the jitter sequence; determine a depth correction coefficient based on the mean and the standard deviation, wherein the larger the jitter, the larger the correction coefficient; and multiply the reference target depth value by the depth correction coefficient to obtain the target depth of the playback layer.

[0022] In one feasible implementation, the first processing module includes: a first calculation unit, configured to monitor the actual occupancy rate of the current playback layer buffer in real time and calculate the deviation between the actual occupancy rate and the target depth of the playback layer; an execution unit, configured to determine that the buffer occupancy is too high when the deviation is greater than a preset first threshold and execute an operation to reduce the transmission rate; and to determine that the buffer occupancy is too low when the deviation is less than a preset second threshold and execute an operation to increase the transmission rate, wherein the preset first threshold is greater than the preset second threshold; a second calculation unit, configured to maintain the current transmission rate unchanged when the deviation is within the range between the preset first threshold and the preset second threshold, and calculate the maximum tolerable retransmission delay based on the current occupancy level of the playback layer buffer; a comparison unit, configured to compare the maximum tolerable retransmission delay with the round-trip delay of the current wireless link and take the smaller of the two as the length of the available retransmission time window; and a first processing unit, configured to update the start time of the time window to the time when the most recent data packet was sent, and when a retransmission request is initiated, only allow data packets that have not yet timed out within the time window to perform retransmission operations.

[0023] In one feasible implementation, the first calculation unit is specifically used to: read the amount of stored data in the current playback layer buffer when each audio frame period arrives, and divide the amount of stored data by the total capacity of the buffer to obtain the actual occupancy rate; subtract a preset playback layer target depth from the actual occupancy rate to obtain an initial deviation value, wherein the playback layer target depth is represented as a percentage of the total buffer capacity; perform low-pass filtering on the initial deviation values ​​obtained in multiple consecutive periods to filter out instantaneous fluctuation noise, and use the filtered value as the final deviation value.

[0024] In one feasible implementation, the second processing module is specifically used to: compare the target transmission mode level with the current transmission mode level, determine the switching direction and level difference, and after the current audio frame is fully encoded and transmitted at the transmitting end, insert a switching alignment flag carrying the target encoding format parameters at the boundary of adjacent audio frames; after the receiving end detects the switching alignment flag, suspend the current decoder state and initialize the new decoder corresponding to the target encoding format; during the switching between the old and new decoders, perform crossfade smooth transition processing on the audio output buffer, and after the switching is completed, the transmitting end and the receiving end synchronously confirm and clear the switching alignment flag.

[0025] In one feasible implementation, the third processing module includes: a judgment unit, used to determine whether the lost data packet falls within the forward error correction protection range after the receiving end detects data packet loss; if it falls within the forward error correction protection range, it attempts to recover the lost data packet based on the received redundant packets; if the recovery is successful, it does not send a retransmission request; if the recovery fails, it generates a negative acknowledgment retransmission request and records the sequence number and timestamp of the lost data packet; if it does not fall within the forward error correction protection range, it directly generates a negative acknowledgment retransmission request and records the sequence number and timestamp of the lost data packet; a second processing unit, used to calculate the delay difference between the current time and the original transmission time of the lost packet, and determine whether the difference is less than or equal to the length of the available retransmission time window: if it is within the window, it allows sending a negative acknowledgment retransmission request; otherwise, it abandons retransmission and triggers audio frame loss hiding processing; and a transmission unit, used to prioritize and send negative acknowledgment retransmission requests according to the importance priority of the data packets when there are multiple lost data packets within the time window, prioritizing the retransmission of data packets corresponding to key audio frames.

[0026] In one feasible implementation, the judgment unit is specifically used to: parse the header of the lost data packet, extract the audio frame sequence number and packet type identifier to which the lost data packet belongs, wherein the packet type identifier is used to distinguish between the original audio data packet and the forward error correction redundant packet; query the forward error correction coding parameters cached locally according to the audio frame sequence number to determine whether the audio frame has forward error correction protection enabled, and the number of forward error correction redundant packets and the redundant packet index range used; if the audio frame has forward error correction protection enabled, and the number of currently received redundant packets meets the recovery conditions, then the lost data packet is determined to be within the scope of forward error correction protection; otherwise, it is determined not to be within the scope of forward error correction protection.

[0027] In one feasible implementation, the transmission unit is specifically used to: divide data packets into three priority levels: I-frame packets, P-frame packets, and non-critical frame packets, wherein I-frame packets have the highest retransmission priority, P-frame packets have the medium retransmission priority, and non-critical frame packets have the lowest retransmission priority; when multiple lost data packets exist within the time window, the negative acknowledgment retransmission requests are sorted according to priority level from high to low, and retransmission requests for I-frame packets are sent first; when the remaining length of the time window is less than a preset threshold, only the highest priority I-frame packets are allowed to initiate retransmission requests, while retransmission requests for P-frame packets and non-critical packets are suppressed.

[0028] A third aspect of the present invention provides an electronic device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor invokes the instructions in the memory to cause the electronic device to perform the above-described audio transmission method based on a wireless environment.

[0029] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the above-described audio transmission method based on a wireless environment.

[0030] The technical solution provided by this invention involves obtaining multi-dimensional channel quality parameters of a wireless link, including received signal strength indication, packet loss rate, round-trip time, and jitter; performing scoring calculations based on these multi-dimensional channel quality parameters to obtain a target link quality score; determining a target transmission mode level based on the target link quality score; determining a corresponding playback layer target depth based on the target transmission mode level; adjusting the transmission rate and determining a retransmission available time window based on a comparison between the actual occupancy rate of the current playback layer buffer and the playback layer target depth; performing encoding format switching processing at audio frame boundaries based on the difference between the target transmission mode level and the current transmission mode level; and performing coordinated forward error correction and negative acknowledgment retransmission processing within the time window when data packet loss is detected. In this embodiment of the invention, by introducing a fusion scoring mechanism of multi-dimensional channel quality parameters, accurate assessment of wireless link status and intelligent classification of transmission mode levels are achieved. Then, the target depth of the playback layer is dynamically matched according to the mode level, and the transmission rate and retransmission time window are adjusted collaboratively. This effectively avoids stuttering caused by buffer underload when the channel deteriorates and unnecessary increase in latency when the channel is good. At the same time, by performing encoding format switching processing at the audio frame boundary, audio interruption or noise in traditional switching methods is eliminated. Combined with the collaborative decision-making mechanism of forward error correction and negative acknowledgment retransmission under the retransmission window constraint, the packet loss recovery efficiency is maximized within a limited latency budget. Thus, the continuity, real-time performance and sound quality stability of audio transmission are significantly improved in the dynamically changing wireless channel environment. Attached Figure Description

[0031] Figure 1 This is a schematic diagram of an embodiment of the audio transmission method based on a wireless environment according to the present invention; Figure 2 This is a schematic diagram of another embodiment of the audio transmission method based on a wireless environment in this invention. Figure 3 This is a schematic diagram of one embodiment of an audio transmission device based on a wireless environment according to the present invention; Figure 4 This is a schematic diagram of another embodiment of the audio transmission device based on a wireless environment according to the present invention; Figure 5 This is a schematic diagram of one embodiment of the electronic device in this invention. Detailed Implementation

[0032] This invention provides an audio transmission method, apparatus, device, and storage medium based on a wireless environment. By adaptively adjusting the transmission mode, buffer depth, and retransmission window through multi-dimensional channel quality scoring, and seamlessly switching encoding formats at audio frame boundaries, the continuity, real-time performance, and sound quality stability of audio transmission under dynamic channels are improved.

[0033] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0034] It is understood that the executing entity of this invention can be an audio transmission device based on a wireless environment, or it can be a terminal or a server; no specific limitation is made here. This embodiment of the invention will be described using a server as an example.

[0035] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 One embodiment of the audio transmission method based on a wireless environment in this invention includes: 101. Obtain multi-dimensional channel quality parameters of the wireless link, including received signal strength indication, packet loss rate, round-trip time, and jitter. By periodically collecting received signal strength indicators through the wireless communication module, calculating the packet loss rate through data packet sequence number detection and repetition calculation, measuring round-trip delay through the timestamp mechanism, and calculating jitter through the variance of the arrival time interval of adjacent data packets, the above parameters are encapsulated to obtain multi-dimensional channel quality parameters.

[0036] 102. The target link quality score is obtained by performing scoring calculations based on multi-dimensional channel quality parameters; A multi-dimensional channel quality nonlinear attenuation weighted fluctuation penalty scoring algorithm (NL-VPS) is used for calculation. Specifically, firstly, the measured values ​​of each channel quality dimension are mapped to sub-scores through an exponential attenuation function, so that the score decreases faster as the channel degradation is more severe, and attenuation is only triggered when the measured value is worse than the quality benchmark threshold. Then, the sub-scores are weighted and summed according to the weights corresponding to the service type. Finally, a fluctuation penalty factor is introduced to comprehensively consider the dispersion of the jitter sequence and the short-term change rate of the packet loss rate to suppress the weighted summation result. This makes the comprehensive score when the channel fluctuates drastically lower than that of a channel with the same average quality but smaller fluctuations, thereby guiding the system to enter a more conservative transmission mode earlier.

[0037] Sub-scores are calculated for four dimensions: received signal strength indication, packet loss rate, round-trip time, and jitter, using the following formulas: Received signal strength indicator sub-rating:

[0038] Packet loss rate score:

[0039] Round-trip delay sub-rating:

[0040] Shaking score:

[0041] in, RSSI degradation (i.e., the difference between the reference value of the good signal and the actual RSSI, in dBm). This represents the packet loss rate (value range: 0~1). Round-trip time (in milliseconds). Jitter (in milliseconds); This is the high-quality benchmark threshold for the i-th dimension. No attenuation deduction is generated when the measured value is lower than this threshold. = max(0, u) is the positive part operator, which ensures that attenuation is triggered only when the channel is inferior to the reference. Attenuation sensitivity coefficient The larger the value, the more severe the impact of the degradation of that dimension on the score.

[0042] Based on the service type identifier of the current audio session (real-time interactive, streaming media playback, or default), select a set of weighting coefficients from the preset weighting coefficient mapping table. ,satisfy Calculate the weighted sum: .

[0043] The volatility penalty factor PP is calculated using the following formula:

[0044] in, It is the normalized standard deviation of the jitter measurements over the most recent M cycles, reflecting the dispersion of jitter, i.e., the irregularity of the channel; This is the short-term change rate of the packet loss rate. This reflects the suddenness of packet loss; Fluctuation penalty adjustment coefficient The degree to which control channel instability suppresses the overall score.

[0045] The final overall quality score for the target link is:

[0046] Its value range is [0, 100]. When the channel quality is stable, and When both are close to 0, P≈1, and the score is not penalized; when the channel fluctuates drastically, PP decreases accordingly, and the overall score is actively suppressed.

[0047] For example: Suppose at a certain moment the channel measurements are RSSI degradation of 20dBm, packet loss rate of 0.05, round-trip time of 80ms, and jitter of 15ms, and the quality benchmark thresholds are set as follows: =0dBm =0、 =30ms =5ms, attenuation sensitivity coefficient set to =0.04、 =20、 =0.015、 =0.04. The business type is streaming media playback, and the weight is taken as... =0.4、 =0.3、 =0.15、 =0.15. The fluctuation parameter is taken as... =0.3、 =0.02、 =0.5、 =2.0. The calculated sub-scores for each dimension are as follows: =44.9、 =36.8、 =47.2、 =67.0, weighted summation yields =44.3, fluctuation penalty factor P=0.87, final comprehensive score Q=38.7. This score falls within the scoring range of anti-interference high redundancy mode or deep coverage keep-alive mode, triggering the corresponding buffer expansion and high redundancy coding strategy.

[0048] 103. Determine the target transmission mode level based on the target link quality score; The transmission mode is pre-divided into multiple levels, each corresponding to a continuous scoring range. For example, the highest scoring range corresponds to the lossless priority mode, in which the system transmits at full speed using lossless audio format to pursue the best sound quality; the second highest range corresponds to the lossless conservative mode, maintaining the lossless format but adopting a more conservative transmission strategy; the medium range corresponds to the lossy transition mode, temporarily switching to high-quality lossy encoding to maintain playback continuity; and the lowest range corresponds to the low-quality guarantee mode, further reducing the bitrate to prioritize uninterrupted playback. The appropriate transmission mode level can be determined based on which range the target link quality score falls into.

[0049] For example, a user is playing FLAC lossless music using a wireless speaker system in the living room. The system continuously calculates the overall quality score of the current link. Assuming the current score is 92, falling into the 80-100 range, it determines that the current priority mode should be used, transmitting audio data at full speed in FLAC format to ensure the best sound quality. If the user then moves the wireless speaker to the balcony, adding two walls between it and the router, the link quality score drops to 65, falling into the 60-79 range. In this case, it automatically switches to a conservative lossless mode, still maintaining FLAC lossless transmission but increasing the playback buffer depth from a shorter 200 milliseconds to 500 milliseconds to handle potential signal fluctuations. If the user moves the speaker further to the basement, the signal deteriorates further, and the link quality score drops to 50, falling into the 40-59 range. In this case, it switches to a lossy transition mode, temporarily switching the encoding format from FLAC to high-quality AAC lossy encoding. Simultaneously, a notification is pushed to the user via the application, informing them that the network signal is weak and the encoding format has been temporarily switched. When the link quality score drops further to 35 points, falling into the score range below 40 points, it enters the low-quality assurance mode, further reducing the encoding bitrate, prioritizing uninterrupted music playback, and triggering the network diagnostic process to suggest that the user optimize the placement of the device.

[0050] 104. Determine the corresponding playback layer target depth based on the target transmission mode level; Each transmission mode level corresponds to a preset playback layer buffer target depth value, which represents the duration of audio data that should be maintained in the receiver's playback buffer. Lossless priority mode uses a shorter buffer depth to reduce latency; lossless conservative mode moderately increases the buffer depth to cope with channel fluctuations; lossy transition mode and low-quality guarantee mode use a deeper buffer depth to accumulate more data to combat sudden packet loss under adverse channel conditions. The corresponding playback layer target depth is selected from the preset mapping relationship based on the target transmission mode level.

[0051] 105. Based on the comparison between the actual occupancy rate of the current playback layer buffer and the target depth of the playback layer, adjust the sending rate and determine the available time window for retransmission; The system monitors the actual occupancy rate of the current playback layer buffer in real time and calculates the deviation between the buffer and the target depth of the playback layer. When the deviation is greater than a preset first threshold, the transmission rate is reduced; when it is less than a preset second threshold, the transmission rate is increased; when it is between the two, the transmission rate remains unchanged. The system also calculates the maximum tolerable retransmission delay based on the current buffer occupancy level. The maximum tolerable retransmission delay is compared with the round-trip delay of the current wireless link, and the smaller value is taken as the length of the available retransmission time window. The update window starts at the moment when the most recent data packet was sent, and retransmission is only allowed for data packets that have not yet timed out within the window.

[0052] 106. Based on the difference between the target transmission mode level and the current transmission mode level, perform encoding format switching at the audio frame boundary; The current transmission mode level and the target transmission mode level are compared before the encoding of each audio frame begins. If they are the same, the switching process is skipped; otherwise, the encoding format switching process is triggered. However, the switching operation is not executed immediately. Instead, it waits until the current audio frame is fully encoded and transmitted before performing the switching operation at the natural boundary between two adjacent audio frames. The transmitting end first releases all internal states of the current encoder and shuts down the encoder instance. Then, it initializes a new encoder according to the encoding format corresponding to the target transmission mode level and loads its parameter configuration. Starting from the next audio frame, it uses the new encoding format for encoding. At the same time, a switching alignment flag carrying the target encoding format parameters is embedded in the first data packet after the switch. After the receiving end detects the switching alignment flag, it suspends the current decoder state at the same frame boundary after completing the decoding and playback of the current frame. It parses the target encoding format parameters carried in the flag and initializes a new decoder corresponding to the target encoding format, thereby ensuring format synchronization on both sides of the encoding and decoding process and preventing audio breaks or noise during the switching process.

[0053] 107. When a data packet loss is detected, perform coordinated processing of forward error correction and negative acknowledgment retransmission within the time window.

[0054] After detecting a lost data packet, the receiving end determines whether the lost data packet falls within the scope of forward error correction protection. If it does, it attempts to recover the packet based on the already received redundant packets. If recovery is successful, no retransmission request is sent; if recovery fails, a negative acknowledgment retransmission request is generated. If the packet does not fall within the scope of forward error correction protection, a negative acknowledgment retransmission request is generated directly. The delay difference between the current time and the original transmission time of the lost packet is calculated. If this difference is less than or equal to the length of the available retransmission time window, a retransmission request is allowed; otherwise, retransmission is abandoned and audio frame loss concealment processing is triggered. When multiple lost data packets exist within the time window, retransmission requests are prioritized according to the importance of the data packets, with priority given to retransmitting data packets corresponding to critical audio frames.

[0055] In this embodiment of the invention, by introducing a fusion scoring mechanism of multi-dimensional channel quality parameters, accurate assessment of wireless link status and intelligent classification of transmission mode levels are achieved. Then, the target depth of the playback layer is dynamically matched according to the mode level, and the transmission rate and retransmission time window are adjusted collaboratively. This effectively avoids stuttering caused by buffer underload when the channel deteriorates and unnecessary increase in latency when the channel is good. At the same time, by performing encoding format switching processing at the audio frame boundary, audio interruption or noise in traditional switching methods is eliminated. Combined with the collaborative decision-making mechanism of forward error correction and negative acknowledgment retransmission under the retransmission window constraint, the packet loss recovery efficiency is maximized within a limited latency budget. Thus, the continuity, real-time performance and sound quality stability of audio transmission are significantly improved in the dynamically changing wireless channel environment.

[0056] Please see Figure 2 Another embodiment of the audio transmission method based on a wireless environment in this invention includes: 201. Obtain multi-dimensional channel quality parameters of the wireless link, including received signal strength indication, packet loss rate, round-trip time, and jitter. The received signal strength indication is periodically collected by the wireless communication module; the packet loss rate is calculated by detecting and recalculating the data packet sequence number; the round-trip delay is measured by the timestamp mechanism; the jitter is calculated by the variance of the arrival time interval of adjacent data packets; and the received signal strength indication, packet loss rate, round-trip delay and jitter are encapsulated to obtain multi-dimensional channel quality parameters.

[0057] The radio frequency driver layer of the wireless communication module is configured to trigger a read command for the received signal strength indicator at a fixed period. The unfiltered raw power value is directly obtained from the automatic gain control register or the received signal strength indicator lookup table of the baseband processor and converted into an integer value in deciwatts for local buffering. The packet loss rate is calculated using a sliding window mechanism. The transmitter embeds a 16-bit incrementing sequence number in the header of each data packet. The receiver maintains a bitmap structure recording the arrival status of the N most recent sequence numbers. Whenever a sequence number gap is detected, a timer is immediately triggered to accumulate the loss count, and the ratio of the loss count to the total number of packets within the window is periodically output as the packet loss rate. Round-trip time delay is measured using a local clock stamp carried in the data packet. The transmitter reads the microsecond-level count value of a high-precision timer and writes it into the packet at the instant the data packet is sent. Upon receiving the packet, the receiver immediately sends back an acknowledgment packet, copying the timestamp verbatim into the acknowledgment packet. When the transmitter receives the acknowledgment packet, it reads the timer again; the difference between the two timer readings is the round-trip time delay. Jitter is calculated using a real-time variance recursive formula. For each arriving data packet, its reception time is recorded, the arrival time interval with the previous packet is calculated, and then the mean and variance of the interval are dynamically updated using an exponentially weighted moving average method. This avoids storing all historical data. Finally, the square root of the variance is output as the jitter value. These four parameters are encapsulated into a structure according to a fixed protocol format to obtain multi-dimensional channel quality parameters.

[0058] 202. The target link quality score is obtained by performing scoring calculations based on multi-dimensional channel quality parameters; The received signal strength indicator, packet loss rate, round-trip time, and jitter are mapped to a unified scoring range to obtain sub-scores for each dimension. Based on the service type identifier of the current audio session, a set of weighting coefficients is selected from a preset weighting coefficient mapping table. The service type identifier includes real-time interactive, streaming media playback, and default types. Different service types correspond to different weighting coefficient configurations, and the sum of the weighting coefficients for received signal strength indicator, packet loss rate, round-trip time, and jitter is 1. The sub-scores of each dimension and their corresponding weighting coefficients are weighted and summed to obtain the target link quality score.

[0059] For example, received signal strength indication, packet loss rate, round-trip time delay (RTD), and jitter are mapped to a unified scoring range of 0 to 100 points. For received signal strength indication, a piecewise linear mapping function is used, mapping 100 points when the measured value is above -50dBm and 0 points when it is below -90dBm, with intermediate values ​​calculated by linear interpolation. For packet loss rate, an inverse proportional mapping is used, mapping 100 points when the packet loss rate is 0% and 0 points when the packet loss rate is 20% or higher, with intermediate values ​​calculated using the formula Score_PLR = 100 × (1 - PLR / 0.2). For RTD, an exponential decay mapping is used, mapping 100 points when the delay is 0ms, with the score decreasing exponentially by 20% for every 50ms increase in delay. For jitter, the same exponential decay mapping method as for RTD is used. After calculating the sub-scores for each dimension, the receiving end parses the service type identifier passed in by the upper-layer application when the audio session is established: If the identifier is "Real-time Interaction" (corresponding to scenarios such as voice calls and video conferencing), a low-latency priority configuration is selected from the weighted coefficient mapping table, i.e., packet loss rate coefficient 0.35, jitter coefficient 0.35, received signal strength indicator coefficient 0.15, and round-trip delay coefficient 0.15; if the identifier is "Streaming Media Playback" (corresponding to scenarios such as online music and podcasts), a high-fidelity priority configuration is selected, i.e., received signal strength indicator coefficient 0.4, packet loss rate coefficient 0.3, round-trip delay coefficient 0.15, and jitter coefficient 0.15; if the identifier is "Default" or a valid identifier cannot be obtained, a balanced configuration is selected, i.e., received signal strength indicator coefficient 0.2, packet loss rate coefficient 0.4, round-trip delay coefficient 0.2, and jitter coefficient 0.2. The sum of the four weighted coefficients is 1 under all three configurations. Finally, the sub-scores of each dimension are multiplied by their corresponding weighting coefficients and summed to obtain the target link quality score. The score results for multiple consecutive periods are then smoothed using an exponentially weighted moving average filter to eliminate instantaneous fluctuation noise.

[0060] 203. Determine the target transmission mode level based on the target link quality score; Multiple consecutive link quality score intervals are pre-divided, and a transmission mode level is configured for each score interval. The transmission mode levels include high-speed low redundancy mode, balanced adaptation mode, anti-interference high redundancy mode, and deep coverage keep-alive mode. The target link quality score is matched and compared with each link quality score interval to determine the target score interval in which the target link quality score is located. The transmission mode level corresponding to the target score interval is output as the target transmission mode level, and the preset encoding format, forward error correction redundancy rate, and retransmission timeout configuration parameters under the transmission mode level are obtained simultaneously.

[0061] The complete range of link quality scores is divided into multiple consecutive scoring intervals, each closely adjacent and non-overlapping on the number axis. For each scoring interval, a corresponding transmission mode level is pre-configured. These levels are set in descending order of link quality as: high-speed low-redundancy mode, balanced adaptation mode, anti-interference high-redundancy mode, and deep coverage keep-alive mode. High-speed low-redundancy mode corresponds to the highest link quality scoring interval, where channel conditions are ideal and data packet transmission is stable. Balanced adaptation mode corresponds to the second highest interval, suitable for general quality environments. Anti-interference high-redundancy mode corresponds to a lower interval, indicating significant channel interference or attenuation. Deep coverage keep-alive mode corresponds to the lowest interval, used for extreme conditions such as signal coverage edges. After completing the interval division and level configuration, the target link quality score is compared sequentially with the boundary values ​​of each scoring interval to determine which interval the score falls into, thus identifying its target scoring interval. Then, the corresponding transmission mode level is found based on the target scoring interval, and its output is used as the target transmission mode. At the same time, a set of pre-defined transmission parameters for this transmission mode level is synchronously read from a local configuration library. These parameters include the encoding format, forward error correction redundancy rate, and retransmission timeout. The encoding format determines how the audio data is compressed, the forward error correction redundancy rate specifies how much error correction protection data is added on top of the original data, and the retransmission timeout sets the maximum time the sender waits for an acknowledgment packet.

[0062] 204. Determine the corresponding playback layer target depth based on the target transmission mode level; Obtain a mapping table between transmission mode level and playback layer target depth, where a lower transmission mode level corresponds to a larger playback layer target depth. Query the mapping table based on the target transmission mode level to obtain the baseline target depth value corresponding to that level. Dynamically correct the baseline target depth value based on the historical jitter trend of the wireless link to obtain the playback layer target depth. Specifically, collect the most recent M jitter values ​​to form a jitter history sequence, and calculate the mean and standard deviation of the jitter sequence. Determine the depth correction coefficient based on the mean and standard deviation, where a larger jitter corresponds to a larger correction coefficient. Multiply the baseline target depth value by the depth correction coefficient to obtain the playback layer target depth.

[0063] A mapping table is established between transmission mode levels and target playback layer depths. This table specifies that lower transmission mode levels (i.e., poorer link quality) correspond to larger target playback layer depths, allowing the buffer to store more audio data to mitigate network fluctuations. The mapping table explicitly records a baseline target depth value for each transmission mode level, expressed as a percentage of the total buffer capacity. Once the target transmission mode level is determined, it is immediately used as the key to query the mapping table and directly retrieve the baseline target depth value associated with that level. After obtaining the baseline target depth value, it is dynamically corrected using the historical jitter trends of the wireless link, ensuring the final target depth adapts to short-term channel fluctuations. The correction process first collects several recent jitter measurements, arranging these values ​​chronologically to form a jitter history sequence. Statistical analysis is performed on this sequence, calculating the arithmetic mean of all jitter values ​​to reflect the central tendency of the jitter, and simultaneously calculating the standard deviation of the sequence to reflect the dispersion of the jitter. Based on the calculated mean and standard deviation, a depth correction coefficient is determined using a pre-defined function. This function is designed so that the larger the mean or standard deviation of the jitter, the larger the output value of the correction coefficient; that is, severe jitter leads to a larger correction coefficient. Finally, the baseline target depth value is multiplied by this depth correction coefficient to obtain the final target depth of the playback layer.

[0064] 205. Based on the comparison between the actual occupancy rate of the current playback layer buffer and the target depth of the playback layer, adjust the sending rate and determine the available time window for retransmission; The system monitors the actual occupancy rate of the current playback layer buffer in real time and calculates the deviation between the actual occupancy rate and the target depth of the playback layer. Specifically, at the arrival of each audio frame cycle, the amount of stored data in the current playback layer buffer is read, and the amount of stored data is divided by the total capacity of the buffer to obtain the actual occupancy rate. The target depth of the playback layer is subtracted from the actual occupancy rate to obtain the initial deviation value, where the target depth of the playback layer is expressed as a percentage of the total buffer capacity. The initial deviation values ​​obtained from multiple consecutive cycles are low-pass filtered to remove instantaneous fluctuation noise, and the filtered value is used as the final deviation value. When the deviation value is greater than a preset first threshold, it is determined that the buffer occupancy is too high, and the transmission rate is reduced. When the deviation value is less than the preset second threshold, it is determined that the buffer occupancy is too low, and the operation of increasing the transmission rate is executed. The preset first threshold is greater than the preset second threshold. When the deviation value is within the range between the preset first threshold and the preset second threshold, the current transmission rate is maintained, and the maximum tolerable retransmission delay is calculated based on the current playback layer buffer occupancy level. The maximum tolerable retransmission delay is compared with the current round-trip delay of the wireless link, and the smaller value is taken as the length of the available retransmission time window. The start time of the updated time window is the time when the most recent data packet was sent, and when a retransmission request is initiated, only data packets that have not yet timed out within the time window are allowed to perform retransmission operations.

[0065] Establish a periodically triggered interrupt or timed task to execute the buffer monitoring process at the arrival of each audio frame period. At the trigger time of this period, directly read the amount of data stored in the current playback layer buffer that has not yet been decoded and played. This data amount is usually recorded in the form of bytes or audio sample points in the buffer management structure. At the same time, obtain the total capacity of the buffer, divide the two to get a floating-point number between zero and one, and then multiply by 100% to convert it into a percentage of actual occupancy. After the actual occupancy is calculated, the target depth of the playback layer is also regarded as a percentage value. Subtract the target depth of the playback layer from the actual occupancy to obtain the initial deviation value. This deviation value can be positive or negative. A positive value indicates that there is too much data in the buffer, and a negative value indicates that there is not enough data in the buffer.

[0066] Because a single measurement may contain noise from transient network bursts, the initial deviation value is low-pass filtered. Specifically, a one-dimensional array of fixed length is maintained as a circular queue. At the end of each audio frame period, the latest initial deviation value is pushed to the tail of the queue, while the oldest data at the head of the queue is popped. The arithmetic mean of all deviation values ​​in the queue is calculated as the final filtered deviation value. Alternatively, an exponentially weighted moving average method can be used, assigning a higher weight to the initial deviation value of the current period and a decreasing weight to historical values, thus filtering out noise while retaining rapid responsiveness to trend changes.

[0067] After obtaining the final deviation value, it is compared with two preset thresholds. The first threshold, called the high-water mark threshold, is a positive number; the second threshold, called the low-water mark threshold, is a negative number. The absolute values ​​of the high-water mark threshold and the low-water mark threshold may not be equal, but the high-water mark threshold is numerically greater than the low-water mark threshold. When the deviation value is greater than the high-water mark threshold, it is determined that the buffer is over-occupied, indicating an imminent or already existing risk of overflow. Therefore, an instruction is issued to the sender to reduce the transmission rate, specifically by requesting the sender to reduce the number of data packets sent in each burst or to extend the interval between adjacent bursts. When the deviation value is less than the low-water mark threshold, it is determined that the buffer is under-occupied, indicating an imminent or already existing risk of playback starvation. Therefore, an instruction is issued to the sender to increase the transmission rate, requesting the sender to increase the data packet transmission density. When the final deviation value is between the low-water mark threshold and the high-water mark threshold, the buffer is considered to be in a healthy equilibrium state, and the current transmission rate is maintained.

[0068] To maintain a constant transmission rate, the available time window length for retransmission needs to be calculated. First, the maximum tolerable retransmission latency is calculated based on the actual occupancy level of the current playback layer buffer. The calculation logic is as follows: the amount of data currently stored in the buffer determines how much extra waiting time is acceptable for retransmission packets to arrive without playback starvation. Specifically, the duration of the audio data currently stored in the buffer is used as a baseline, and a safety margin is subtracted to obtain the maximum tolerable retransmission latency. Simultaneously, the current wireless link round-trip latency is obtained. This round-trip latency represents the shortest time required from initiating a retransmission request to receiving the retransmitted data. The maximum tolerable retransmission latency is compared with the round-trip latency, and the smaller value is taken as the available time window length for retransmission. This time window length ensures that data packets initiated and completed within this window can be decoded and used before the playback point.

[0069] In addition, a dynamically updated start time of the retransmission time window is maintained. Each time the sending end completes the transmission of a data packet, it records the completion time and sets it as the start time of the retransmission time window. When the receiving end detects a lost data packet and prepares to initiate a retransmission request, it first calculates the delay difference between the current time and the original transmission time of the lost packet. Then, it compares this difference with the available retransmission time window length. Only when the delay difference is less than or equal to the time window length is the retransmission request for the lost packet actually sent. For lost packets that have been determined to be outside the time window, retransmission is abandoned, and instead, the audio frame loss concealment mechanism is triggered. This method ensures that retransmission operations do not waste valuable channel resources transmitting data packets that, even if successfully arrived, cannot be played on time.

[0070] 206. Based on the difference between the target transmission mode level and the current transmission mode level, perform encoding format switching processing at the audio frame boundary; The target transmission mode level is compared with the current transmission mode level to determine the switching direction and level difference. After the current audio frame is fully encoded and transmitted at the sending end, a switching alignment flag carrying the target encoding format parameters is inserted at the boundary of the adjacent audio frame. After the receiving end detects the switching alignment flag, it suspends the current decoder state and initializes the new decoder corresponding to the target encoding format. During the switching between the old and new decoders, a crossfade smooth transition is performed on the audio output buffer. After the switching is completed, the sending end and the receiving end synchronously confirm and clear the switching alignment flag.

[0071] The target transmission mode level is compared with the currently used transmission mode level. Before encoding each audio frame begins, these two levels are compared. If they are the same, the switching process is skipped; if they are different, the switching direction (upgrade or downgrade) and the difference in levels are recorded. The transmitter does not immediately interrupt the ongoing encoding operation but continuously monitors the encoder output status of the current audio frame. It waits until all the raw audio data of the current audio frame has been encoded and a complete set of data packets has been generated and delivered to the lower-level transmission module before performing the switching operation at the natural boundary between two adjacent audio frames. At the boundary, the transmitter constructs a special switching alignment flag. The packet's header uses a specific type identifier value not occupied by ordinary audio packets and forward error correction redundancy packets. Its payload carries a complete set of parameters for the target encoding format, including encoding algorithm type, sampling rate, bit rate, frame length, channel configuration, and various custom parameters required for encoder initialization. This switching alignment flag packet is then inserted between the last packet of the current audio frame and the first packet of the next audio frame and sent out. Upon receiving each packet, the receiver first checks its header type identifier. Upon recognizing the switching alignment flag packet, it immediately pauses the current decoding process and parses the target encoding format carried in the flag payload. The parameters are used to first release all memory resources currently occupied by the decoder, including the internal state table and reference frame buffer. Then, based on the extracted parameters, a new decoder instance corresponding to the target encoding format is initialized from scratch, including allocating necessary buffers and setting the initial decoding state. During the switching between the old and new decoders, the audio output buffer of the receiver will briefly contain residual audio samples generated by the old decoder and the initial audio samples output by the new decoder. To avoid audio breaks or pops during the switching, the receiver performs a crossfade smooth transition. Specifically, a fixed-length overlapping window is defined in the audio output buffer, and the first half of the overlapping window is processed linearly from 100%... The receiver plays the residual samples output by the old decoder with a weight decreasing to zero. In the latter half of the overlapping window, the receiver plays the initial samples output by the new decoder with a weight increasing linearly from zero to 100%. The weights of the two segments are each 50% at the center point of the overlapping window to achieve smooth energy splicing. After the handover is completed, the receiver sends a handover confirmation message to the transmitter through the reverse control channel. After receiving the confirmation message, the transmitter clears the handover alignment flag transmission status recorded locally and updates the target transmission mode level to the current transmission mode level. If the transmitter does not receive the confirmation message within the preset timeout period, it retransmits the handover alignment flag or falls back to the old encoding format to ensure service continuity.

[0072] 207. After the receiving end detects a data packet loss, it determines whether the lost data packet falls within the scope of forward error correction protection. If it does, it attempts to recover the lost data packet based on the already received redundant packets. If the recovery is successful, no retransmission request is sent. If the recovery fails, a negative acknowledgment retransmission request is generated and the sequence number and timestamp of the lost data packet are recorded. If it does not fall within the scope of forward error correction protection, a negative acknowledgment retransmission request is directly generated and the sequence number and timestamp of the lost data packet are recorded. Parse the header of the lost data packet to extract the audio frame sequence number and packet type identifier to which the lost data packet belongs. The packet type identifier is used to distinguish the original audio data packet from the forward error correction redundancy packet. Based on the audio frame sequence number, query the forward error correction coding parameters cached locally to determine whether the audio frame has forward error correction protection enabled, as well as the number of forward error correction redundancy packets and the redundancy packet index range used. If the audio frame has forward error correction protection enabled, and the number of redundancy packets currently received meets the recovery conditions, then the lost data packet is determined to be within the scope of forward error correction protection; otherwise, it is determined not to be within the scope of forward error correction protection.

[0073] Upon detecting data packet loss, the receiving end first reads two key fields from a fixed offset position in the header of the lost data packet. The first field is the audio frame sequence number, used to identify which consecutive audio coded frames the data packet belongs to. The second field is the packet type identifier, which occupies a separate bit in the header. When this bit is 0, it indicates that the packet is a raw audio data packet; when it is 1, it indicates that the packet is a forward error correction redundant packet. Based on the extracted audio frame sequence number, the receiving end searches its local forward error correction coding parameter cache table. This cache table is pre-distributed by the sending end via the control channel before each audio frame begins transmission. The table records three key pieces of information for each audio frame sequence number: a Boolean flag indicating whether forward error correction protection is enabled, the total number of forward error correction redundant packets generated for that audio frame, and the start and end index ranges of these redundant packets in the redundant packet sequence. The receiving end first checks the enable flag of the audio frame. If the flag is false, it directly determines that the lost packet does not belong to the forward error correction protection range. If the enable flag is true, the receiving end further counts the number of data packets that belong to the audio frame and whose packet type is identified as a forward error correction redundant packet among all the data packets currently received. The count is compared with the total number of redundant packets configured for the audio frame. At the same time, it checks whether the index of these received redundant packets covers the minimum index set required to recover the lost packet. Only when the number of received redundant packets reaches or exceeds the preset recovery threshold, and the index coverage meets the requirements of the forward error correction decoding algorithm, is the lost data packet determined to belong to the forward error correction protection range. Otherwise, even if forward error correction protection is enabled, if the redundant packets are insufficient or the index is incomplete, it is determined not to belong to the forward error correction protection range, and the subsequent retransmission judgment process needs to be executed.

[0074] 208. Calculate the time delay difference between the current time and the original time of the lost packet transmission, and determine whether the difference is less than or equal to the length of the available time window for retransmission: if it is within the window, allow sending a negative acknowledgment retransmission request; otherwise, abandon retransmission and trigger audio frame loss hiding processing. After determining that a lost packet needs to be retransmitted, the receiving end first reads the original transmission time of the lost packet from the locally stored packet loss record. This time is a high-precision timestamp embedded in the packet when it was sent by the sending end. The receiving end has already parsed and cached this timestamp in the packet loss tracking table when it receives the preceding data packet of the same class. The receiving end then reads the current local clock value and subtracts the original transmission time of the lost packet from the current time to calculate the time delay difference from the transmission of the data packet to the current time. The retransmission available time window length is a dynamic value in microseconds, representing the maximum allowable delay from the time the lost packet was sent, giving the retransmission request a chance to allow the retransmitted data to arrive before the playback deadline. This time delay difference is compared with the retransmission available time window length. If the time delay difference... If the delay difference is less than or equal to the time window length, it indicates that after a retransmission request is initiated at the current moment, the data packet retransmitted by the sender may still arrive and be decoded and played before the buffer runs out. Therefore, the receiver allows the generation and sending of a negative acknowledgment retransmission request, which carries the sequence number and timestamp of the lost packet so that the sender can accurately locate the data that needs to be retransmitted. If the delay difference is greater than the time window length, it means that even if a retransmission is requested immediately, the arrival time of the retransmitted data packet will be later than the expected playback time of the audio frame. At this time, the retransmission request is abandoned, and the audio frame loss concealment processing module is immediately triggered. This module uses waveform repetition, packet loss masking algorithm or adjacent frame interpolation to estimate and fill in the lost audio content based on the context of the lost packet, so as to minimize the auditory degradation.

[0075] 209. When multiple data packets are lost within a time window, negative acknowledgment retransmission requests are sorted and sent according to the importance of the data packets, with priority given to retransmitting data packets corresponding to key audio frames.

[0076] Data packets are divided into three priority levels: I-frame packets, P-frame packets, and non-critical frame packets. I-frame packets have the highest retransmission priority, P-frame packets have the medium retransmission priority, and non-critical frame packets have the lowest retransmission priority. When multiple data packets are lost within a time window, negative acknowledgment retransmission requests are sorted from highest to lowest priority, with retransmission requests for I-frame packets being sent first. When the remaining length of the time window is less than a preset threshold, only the highest priority I-frame packets are allowed to initiate retransmission requests, while retransmission requests for P-frame packets and non-critical frame packets are suppressed.

[0077] When encoding each audio frame, the transmitting end explicitly marks a priority level field in the packet header according to the frame type. I-frame packets, as key frames for intra-frame coding and carrying complete audio spectrum information, are marked with the highest retransmission priority. P-frame packets, as forward prediction frames that depend on preceding I-frames or P-frames, are marked with a medium retransmission priority. Non-key frame packets, including B-frames and auxiliary data packets, are marked with the lowest retransmission priority because they do not affect the decoding integrity of subsequent frames. The receiving end internally maintains a priority-ordered retransmission request queue. Whenever multiple lost data packets are detected within the available retransmission time window, they are not processed according to the order of loss time. Instead, based on the priority level read from the header of each lost packet, retransmission requests for I-frame packets are placed at the head of the queue, P-frame packets in the middle, and non-key frame packets at the tail. When sending a retransmission request, the receiver retrieves and sends the request sequentially from the head of the queue. Simultaneously, the receiver continuously tracks the remaining length of the available retransmission time window, which decreases continuously as the clock advances. The receiver presets a threshold for the remaining length of the time window. When the remaining length is greater than the threshold, all retransmission requests are processed normally according to the complete three-level priority order. When the remaining length decreases to less than or equal to the threshold, the receiver enters emergency protection mode. At this time, the receiver traverses the retransmission request queue and discards all retransmission requests for P-frame packets and non-critical frame packets, retaining only retransmission requests for I-frame packets for continued transmission. At the same time, medium and lowest priority requests that have been queued but not yet sent are directly cleared to ensure that the limited time window resources are used entirely for the most critical I-frame recovery, avoiding low-priority retransmissions from crowding out the window time of high-priority retransmissions.

[0078] In this embodiment of the invention, a forward error correction protection range judgment, a retransmission time window precise decision, and a multi-packet priority sorting retransmission mechanism are added, which further reduces invalid retransmission requests and prioritizes the recovery of key audio frames within a limited latency budget, thereby improving playback continuity and sound quality stability under dynamic wireless channels.

[0079] The audio transmission method based on a wireless environment in the embodiments of the present invention has been described above. The audio transmission device based on a wireless environment in the embodiments of the present invention will be described below. Please refer to [link / reference]. Figure 3 One embodiment of the audio transmission device based on a wireless environment in this invention includes: The acquisition module 301 is used to acquire multi-dimensional channel quality parameters of the wireless link, including received signal strength indication, packet loss rate, round-trip time, and jitter. The calculation module 302 is used to perform scoring calculations based on multi-dimensional channel quality parameters to obtain the target link quality score. The first determining module 303 is used to determine the target transmission mode level based on the target link quality score; The second determining module 304 is used to determine the corresponding playback layer target depth based on the target transmission mode level; The first processing module 305 is used to adjust the sending rate and determine the available time window for retransmission based on the comparison result between the actual occupancy rate of the current playback layer buffer and the target depth of the playback layer. The second processing module 306 is used to perform encoding format switching processing at the audio frame boundary based on the difference between the target transmission mode level and the current transmission mode level. The third processing module 307 is used to perform coordinated processing of forward error correction and negative acknowledgment retransmission within a time window when a data packet loss is detected.

[0080] The beneficial effects of the embodiments of the present invention are the same as those described in Embodiment 1, and will not be repeated here.

[0081] Please see Figure 4 Another embodiment of the audio transmission device based on a wireless environment in this invention includes, in addition to the aforementioned, [other embodiments]. Figure 3 In addition to the modules in the document, it also includes: Optionally, the acquisition module 301 can be specifically used for: The received signal strength indication is periodically collected by the wireless communication module; the packet loss rate is calculated by detecting and recalculating the data packet sequence number; the round-trip delay is measured by the timestamp mechanism; the jitter is calculated by the variance of the arrival time interval of adjacent data packets; and the received signal strength indication, packet loss rate, round-trip delay and jitter are encapsulated to obtain multi-dimensional channel quality parameters.

[0082] Optionally, the calculation module 302 can be specifically used for: The received signal strength indicator, packet loss rate, round-trip time, and jitter are mapped to a unified scoring range to obtain sub-scores for each dimension. Based on the service type identifier of the current audio session, a set of weighting coefficients is selected from a preset weighting coefficient mapping table. The service type identifier includes real-time interactive, streaming media playback, and default types. Different service types correspond to different weighting coefficient configurations, and the sum of the weighting coefficients for received signal strength indicator, packet loss rate, round-trip time, and jitter is 1. The sub-scores of each dimension and their corresponding weighting coefficients are weighted and summed to obtain the target link quality score.

[0083] Optionally, the first determining unit 303 is specifically used for: Multiple consecutive link quality score intervals are pre-divided, and a transmission mode level is configured for each score interval. The transmission mode levels include high-speed low redundancy mode, balanced adaptation mode, anti-interference high redundancy mode, and deep coverage keep-alive mode. The target link quality score is matched and compared with each link quality score interval to determine the target score interval in which the target link quality score is located. The transmission mode level corresponding to the target score interval is output as the target transmission mode level, and the preset encoding format, forward error correction redundancy rate, and retransmission timeout configuration parameters under the transmission mode level are obtained simultaneously.

[0084] Optionally, the second determining module 304 includes: The first acquisition unit 3041 is used to acquire a mapping table between transmission mode level and playback layer target depth, wherein the lower the transmission mode level, the greater the corresponding playback layer target depth. The second acquisition unit 3042 is used to query the mapping relationship table according to the target transmission mode level and obtain the baseline target depth value corresponding to the target transmission mode level. The correction unit 3043 is used to dynamically correct the reference target depth value according to the historical jitter trend of the wireless link to obtain the target depth of the playback layer.

[0085] Optionally, the correction unit 3043 can be specifically used for: Collect the most recent M jitter values ​​to form a jitter history sequence, and calculate the mean and standard deviation of the jitter sequence; determine the depth correction coefficient based on the mean and standard deviation, where the larger the jitter, the larger the correction coefficient; multiply the baseline target depth value by the depth correction coefficient to obtain the target depth of the playback layer.

[0086] Optionally, the first processing module 305 includes: The first calculation unit 3051 is used to monitor the actual occupancy rate of the current playback layer buffer in real time and calculate the deviation between the actual occupancy rate and the target depth of the playback layer. The execution unit 3052 is used to determine that the buffer is occupied too high when the deviation value is greater than a preset first threshold and to perform an operation to reduce the transmission rate; and to determine that the buffer is occupied too low when the deviation value is less than a preset second threshold and to perform an operation to increase the transmission rate, wherein the preset first threshold is greater than the preset second threshold. The second calculation unit 3053 maintains the current transmission rate unchanged when the deviation value is within the range between the preset first threshold and the preset second threshold, and calculates the maximum tolerable retransmission delay based on the current occupancy level of the playback layer buffer. The comparison unit 3054 is used to compare the maximum tolerable retransmission delay with the round-trip delay of the current wireless link, and take the smaller value of the two as the length of the available time window for retransmission. The first processing unit 3055 is used to update the start time of the time window to the time when the most recent data packet was sent, and when a retransmission request is initiated, only data packets that have not yet timed out within the time window are allowed to be retransmitted.

[0087] Optionally, the first computing unit 3051 can be specifically used for: At the arrival of each audio frame cycle, the amount of stored data in the current playback layer buffer is read, and the amount of stored data is divided by the total capacity of the buffer to obtain the actual occupancy rate; the actual occupancy rate is subtracted from the preset playback layer target depth to obtain the initial deviation value, where the playback layer target depth is represented as a percentage of the total buffer capacity; the initial deviation values ​​obtained from multiple consecutive cycles are subjected to low-pass filtering to filter out instantaneous fluctuation noise, and the filtered value is used as the final deviation value.

[0088] Optionally, the second processing module 306 can be specifically used for: The target transmission mode level is compared with the current transmission mode level to determine the switching direction and level difference. After the current audio frame is fully encoded and transmitted at the sending end, a switching alignment flag carrying the target encoding format parameters is inserted at the boundary of the adjacent audio frame. After the receiving end detects the switching alignment flag, it suspends the current decoder state and initializes the new decoder corresponding to the target encoding format. During the switching between the old and new decoders, a crossfade smooth transition is performed on the audio output buffer. After the switching is completed, the sending end and the receiving end synchronously confirm and clear the switching alignment flag.

[0089] Optionally, the third processing module 307 includes: The judgment unit 3071 is used to determine whether the lost data packet falls within the scope of forward error correction protection after the receiving end detects the loss of the data packet; if it falls within the scope of forward error correction protection, it attempts to recover the lost data packet based on the received redundant packets; if the recovery is successful, no retransmission request is sent; if the recovery fails, a negative acknowledgment retransmission request is generated and the sequence number and timestamp of the lost data packet are recorded; if it does not fall within the scope of forward error correction protection, a negative acknowledgment retransmission request is directly generated and the sequence number and timestamp of the lost data packet are recorded. The second processing unit 3072 is used to calculate the delay difference between the current time and the original transmission time of the lost packet, and determine whether the difference is less than or equal to the length of the available time window for retransmission: if it is within the window, a negative acknowledgment retransmission request is allowed; otherwise, retransmission is abandoned and audio frame loss hiding processing is triggered. The transmission unit 3073 is used to prioritize and send negative acknowledgment retransmission requests according to the importance of the data packets when there are multiple lost data packets within the time window, and to prioritize the retransmission of data packets corresponding to key audio frames.

[0090] Optionally, the judgment unit 3071 can be specifically used for: Parse the header of the lost data packet to extract the audio frame sequence number and packet type identifier to which the lost data packet belongs. The packet type identifier is used to distinguish the original audio data packet from the forward error correction redundancy packet. Based on the audio frame sequence number, query the forward error correction coding parameters cached locally to determine whether the audio frame has forward error correction protection enabled, as well as the number of forward error correction redundancy packets and the redundancy packet index range used. If the audio frame has forward error correction protection enabled, and the number of redundancy packets currently received meets the recovery conditions, then the lost data packet is determined to be within the scope of forward error correction protection; otherwise, it is determined not to be within the scope of forward error correction protection.

[0091] Optionally, the transmission unit 3073 can be specifically used for: Data packets are divided into three priority levels: I-frame packets, P-frame packets, and non-critical frame packets. I-frame packets have the highest retransmission priority, P-frame packets have the medium retransmission priority, and non-critical frame packets have the lowest retransmission priority. When multiple data packets are lost within a time window, negative acknowledgment retransmission requests are sorted from highest to lowest priority, with retransmission requests for I-frame packets being sent first. When the remaining length of the time window is less than a preset threshold, only the highest priority I-frame packets are allowed to initiate retransmission requests, while retransmission requests for P-frame packets and non-critical frame packets are suppressed.

[0092] The beneficial effects of this embodiment are the same as those described in Embodiment 2, and will not be repeated here.

[0093] above Figure 3 and Figure 4 The audio transmission device based on the wireless environment in the embodiments of the present invention will be described in detail from the perspective of modular functional entities. The electronic device in the embodiments of the present invention will be described in detail from the perspective of hardware processing.

[0094] See Figure 5 As shown, the electronic device includes a processor 500 and a memory 501. The memory 501 stores machine-executable instructions that can be executed by the processor 500. The processor 500 executes the machine-executable instructions to implement the above-described audio transmission method based on a wireless environment.

[0095] Furthermore, Figure 5 The electronic device shown also includes a bus 502 and a communication interface 503. The processor 500, the communication interface 503 and the memory 501 are connected via the bus 502.

[0096] The memory 501 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 503 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 502 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0097] The processor 500 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 500 or by instructions in software form. The processor 500 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 501. The processor 500 reads the information in memory 501 and, in conjunction with its hardware, completes the method steps of the aforementioned embodiment.

[0098] The present invention also provides an electronic device, the computer device including a memory and a processor, the memory storing computer-readable instructions, which, when executed by the processor, cause the processor to perform the steps of the audio transmission method based on the wireless environment described in the above embodiments.

[0099] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of the audio transmission method based on a wireless environment.

[0100] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0101] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0102] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for audio transmission based on a wireless environment, characterized by, The audio transmission method based on a wireless environment includes: The multi-dimensional channel quality parameters of the wireless link are obtained, including received signal strength indication, packet loss rate, round-trip time, and jitter. The target link quality score is obtained by performing scoring calculations based on the multi-dimensional channel quality parameters. The target transmission mode level is determined based on the target link quality score. The corresponding playback layer target depth is determined based on the target transmission mode level; Based on the comparison between the actual occupancy rate of the current playback layer buffer and the target depth of the playback layer, the sending rate is adjusted, and a time window available for retransmission is determined. Based on the difference between the target transmission mode level and the current transmission mode level, a switching process for the encoding format is performed at the boundary of the audio frame. This includes: comparing the target transmission mode level with the current transmission mode level, determining the switching direction and level difference, and after the current audio frame has been fully encoded and transmitted at the transmitting end, inserting a switching alignment flag carrying the target encoding format parameters at the boundary of the adjacent audio frame; after the receiving end detects the switching alignment flag, suspending the current decoder state and initializing the new decoder corresponding to the target encoding format; during the switching between the old and new decoders, a crossfade smooth transition is performed on the audio output buffer; after the switching is completed, the transmitting end and the receiving end synchronously confirm and clear the switching alignment flag. When a data packet loss is detected, coordinated processing of forward error correction and negative acknowledgment retransmission is performed within the time window, including: after the receiving end detects a data packet loss, it determines whether the lost data packet falls within the forward error correction protection range; if it falls within the forward error correction protection range, it attempts to recover the lost data packet based on the received redundant packets; if the recovery is successful, no retransmission request is sent; if the recovery fails, a negative acknowledgment retransmission request is generated and the sequence number and timestamp of the lost data packet are recorded; if it does not fall within the forward error correction protection range, a negative acknowledgment retransmission request is directly generated and the sequence number and timestamp of the lost data packet are recorded; the delay difference between the current time and the original transmission time of the lost packet is calculated, and it is determined whether the difference is less than or equal to the length of the available retransmission time window: if it is within the window, a negative acknowledgment retransmission request is allowed to be sent; otherwise, retransmission is abandoned and audio frame loss concealment processing is triggered; when there are multiple lost data packets within the time window, the negative acknowledgment retransmission requests are sorted and sent according to the importance priority of the data packets, and the data packets corresponding to the key audio frames are retransmitted first.

2. The wireless environment-based audio transmission method of claim 1, wherein, The acquisition of multi-dimensional channel quality parameters of the wireless link includes: The signal strength indication is periodically collected by the wireless communication module; The packet loss rate is calculated by detecting and recalculating the data packet sequence number. Round-trip latency is measured using a timestamp mechanism; Jitter is calculated by the variance of the arrival time interval between adjacent data packets; The received signal strength indication, packet loss rate, round-trip time, and jitter are encapsulated to obtain multi-dimensional channel quality parameters.

3. The wireless environment-based audio transmission method of claim 1, wherein, The step of calculating and processing the target link quality score based on the multi-dimensional channel quality parameters includes: The received signal strength indication, packet loss rate, round-trip time, and jitter are mapped to a unified scoring range to obtain sub-scores for each dimension. Based on the service type identifier of the current audio session, a set of weighting coefficients is selected from the preset weighting coefficient mapping table. The service type identifier includes real-time interactive class, streaming media playback class and default class. Different service types correspond to different weighting coefficient configurations, and the sum of the weighting coefficients corresponding to the received signal strength indicator, the packet loss rate, the round-trip delay and the jitter is 1. The target link quality score is obtained by summing the sub-scores of each dimension with their corresponding weighting coefficients.

4. The wireless environment-based audio transmission method of claim 1, wherein, The step of determining the target transmission mode level based on the target link quality score includes: Multiple consecutive link quality score intervals are pre-divided, and a transmission mode level is configured for each score interval. The transmission mode levels include high-speed low redundancy mode, balanced adaptation mode, anti-interference high redundancy mode, and deep coverage keep-alive mode. The target link quality score is matched and compared with each link quality score interval to determine the target score interval in which the target link quality score is located; The transmission mode level corresponding to the target scoring range is output as the target transmission mode level, and the preset encoding format, forward error correction redundancy rate and retransmission timeout configuration parameters under the transmission mode level are obtained simultaneously.

5. The wireless environment-based audio transmission method of claim 1, wherein, Determining the corresponding playback layer target depth based on the target transmission mode level includes: Obtain the mapping table between transmission mode level and playback layer target depth, where the lower the transmission mode level, the greater the corresponding playback layer target depth; Query the mapping table according to the target transmission mode level to obtain the baseline target depth value corresponding to the target transmission mode level; The baseline target depth value is dynamically corrected based on the historical jitter trend of the wireless link to obtain the target depth of the playback layer.

6. The wireless environment-based audio transmission method of claim 5, wherein, The step of dynamically correcting the baseline target depth value based on the historical jitter trend of the wireless link to obtain the playback layer target depth includes: Collect the most recent M jitter values ​​to form a jitter history sequence, and calculate the mean and standard deviation of the jitter sequence; The depth correction factor is determined based on the mean and the standard deviation, wherein the greater the jitter, the larger the correction factor. The target depth of the playback layer is obtained by multiplying the reference target depth value by the depth correction coefficient.

7. The wireless environment-based audio transmission method of claim 1, wherein, The step of adjusting the transmission rate and determining the available time window for retransmission based on the comparison between the actual occupancy rate of the current playback layer buffer and the target depth of the playback layer includes: Real-time monitoring of the actual occupancy rate of the current playback layer buffer, and calculation of the deviation between the actual occupancy rate and the target depth of the playback layer; When the deviation value is greater than a preset first threshold, it is determined that the buffer is occupied too high, and the operation of reducing the transmission rate is executed; when the deviation value is less than a preset second threshold, it is determined that the buffer is occupied too low, and the operation of increasing the transmission rate is executed, wherein the preset first threshold is greater than the preset second threshold; When the deviation value is within the range between the preset first threshold and the preset second threshold, the current transmission rate is maintained unchanged, and the maximum tolerable retransmission delay is calculated based on the current occupancy level of the playback layer buffer. The maximum tolerable retransmission delay is compared with the round-trip delay of the current wireless link, and the smaller of the two values ​​is taken as the length of the available time window for retransmission. The start time of the time window is updated to the time when the most recent data packet was sent. When a retransmission request is initiated, only data packets that have not yet timed out within the time window are allowed to be retransmitted.

8. The wireless environment-based audio transmission method of claim 7, wherein, The real-time monitoring of the actual occupancy rate of the current playback layer buffer and the calculation of the deviation between the actual occupancy rate and the target depth of the playback layer include: When each audio frame cycle arrives, read the amount of stored data in the current playback layer buffer, and divide the amount of stored data by the total capacity of the buffer to obtain the actual occupancy rate; Subtract the preset target depth of the playback layer from the actual occupancy rate to obtain the initial deviation value, where the target depth of the playback layer is represented as a percentage of the total buffer capacity; The initial deviation values ​​obtained from multiple consecutive cycles are subjected to low-pass filtering to remove instantaneous fluctuation noise, and the filtered values ​​are used as the final deviation values.

9. The wireless environment-based audio transmission method of claim 1, wherein, The determination of whether a lost data packet falls within the scope of forward error correction protection includes: Parse the header of the lost data packet, extract the audio frame number and packet type identifier to which the lost data packet belongs, and the packet type identifier is used to distinguish the original audio data packet from the forward error correction redundant packet; Based on the audio frame sequence number, query the forward error correction coding parameters in the local cache to determine whether forward error correction protection is enabled for the audio frame, as well as the number of forward error correction redundancy packets and the redundancy packet index range used. If the audio frame has forward error correction protection enabled, and the number of redundant packets received so far meets the recovery conditions, then the lost data packet is determined to be within the scope of forward error correction protection; otherwise, it is determined not to be within the scope of forward error correction protection.

10. The wireless environment-based audio transmission method of claim 1, wherein, The process of prioritizing negative acknowledgment retransmission requests according to the importance of data packets, with priority given to retransmitting data packets corresponding to key audio frames, includes: Data packets are divided into three priority levels: I-frame packets, P-frame packets, and non-critical frame packets. I-frame packets have the highest retransmission priority, P-frame packets have the medium retransmission priority, and non-critical frame packets have the lowest retransmission priority. When multiple data packets are lost within the time window, the negative acknowledgment retransmission requests are sorted in descending order of priority, with retransmission requests for I-frame packets being sent first. When the remaining length of the time window is less than a preset threshold, only the highest priority I-frame packets are allowed to initiate retransmission requests, while retransmission requests for P-frame packets and non-critical frame packets are suppressed.

11. An audio transmission apparatus based on a wireless environment, characterized by, The wireless-based audio transmission device includes: The acquisition module is used to acquire multi-dimensional channel quality parameters of the wireless link, including received signal strength indication, packet loss rate, round-trip time, and jitter. The calculation module is used to perform scoring calculations based on the multi-dimensional channel quality parameters to obtain the target link quality score. The first determining module is used to determine the target transmission mode level based on the target link quality score; The second determining module is used to determine the corresponding playback layer target depth based on the target transmission mode level; The first processing module is used to adjust the sending rate and determine the available time window for retransmission based on the comparison result between the actual occupancy rate of the current playback layer buffer and the target depth of the playback layer. The second processing module is used to perform encoding format switching processing at the audio frame boundary based on the difference between the target transmission mode level and the current transmission mode level. The third processing module is used to perform coordinated processing of forward error correction and negative acknowledgment retransmission within the time window when data packet loss is detected. The second processing module is specifically used to: compare the target transmission mode level with the current transmission mode level, determine the switching direction and level difference, and after the current audio frame is fully encoded and transmitted at the sending end, insert a switching alignment flag carrying the target encoding format parameters at the boundary of adjacent audio frames; after the receiving end detects the switching alignment flag, suspend the current decoder state and initialize the new decoder corresponding to the target encoding format; during the switching between the old and new decoders, perform crossfade smooth transition processing on the audio output buffer, and after the switching is completed, the sending end and the receiving end synchronously confirm and clear the switching alignment flag; The third processing module includes: a judgment unit, used to determine whether the lost data packet falls within the forward error correction protection range after the receiving end detects data packet loss; if it falls within the forward error correction protection range, it attempts to recover the lost data packet based on the received redundant packets; if the recovery is successful, no retransmission request is sent; if the recovery fails, a negative acknowledgment retransmission request is generated and the sequence number and timestamp of the lost data packet are recorded; if it does not fall within the forward error correction protection range, a negative acknowledgment retransmission request is directly generated and the sequence number and timestamp of the lost data packet are recorded; a second processing unit, used to calculate the delay difference between the current time and the original transmission time of the lost packet, and determine whether the difference is less than or equal to the length of the available retransmission time window: if it is within the window, a negative acknowledgment retransmission request is allowed to be sent; otherwise, retransmission is abandoned and audio frame loss hiding processing is triggered; and a transmission unit, used to prioritize and send negative acknowledgment retransmission requests according to the importance priority of the data packets when there are multiple lost data packets within the time window, and prioritize the retransmission of data packets corresponding to key audio frames.

12. An electronic device, comprising: The electronic device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor invokes the instructions in the memory to cause the electronic device to perform the audio transmission method based on a wireless environment as described in any one of claims 1-10.

13. A computer-readable storage medium having stored thereon instructions, the instructions comprising, When the instructions are executed by the processor, they implement the audio transmission method based on a wireless environment as described in any one of claims 1-10.