Adaptive control method and device for audio buffer, terminal equipment and medium

By estimating network latency using a Kalman filter and adaptively adjusting the buffer size, the buffering problem caused by network latency in audio data transmission is solved, resulting in higher audio quality and smoothness.

CN121814845APending Publication Date: 2026-04-07ZHENGZHOU HENGDA INTELLIGENT CONTROL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-14
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In existing technologies, buffer underloading or overflow issues caused by network latency during audio data transmission affect audio quality and user experience.

Method used

A Kalman filter is used to process each audio data packet between audio devices to estimate network latency. The buffer estimate is determined by combining the preset parameter information of the audio devices, and the buffer size is adjusted through smoothing and boundary control processing.

Benefits of technology

It improves the smoothness and quality of audio data transmission, reduces extreme cases of buffer overflow, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121814845A_ABST
    Figure CN121814845A_ABST
Patent Text Reader

Abstract

The invention relates to a self-adaptive control method and device for an audio buffer area, terminal equipment and a medium. The method comprises the following steps: processing each audio data packet between audio equipment by using a Kalman filter to obtain a network delay time estimation value; according to preset parameter information of the audio equipment and the network delay time estimation value of each audio data packet, determining a buffer area estimation value of the corresponding audio data packet; smoothing the buffer area estimation value of the audio data packet to obtain a corresponding buffer area intermediate value; and performing boundary control processing on the buffer intermediate value through constraint conditions to obtain a buffer target value, and taking the buffer target value as a buffer size value of the audio data packet. According to the invention, the audio data transmission quality between devices can be improved, and a user can obtain better use experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of audio technology and relates to an adaptive control method, device, terminal equipment, and medium for an audio buffer. Background Technology

[0002] like Figure 1 The audio data shown is broadcast to other terminal devices (remote controllers) to enable communication between devices. The embedded device uses streaming transmission, which means that fixed-time (sampling period / sampling rate) audio data packets collected by the embedded sound card (ALSA) are pre-stored in the device's transmission buffer. Once the buffer is full, the audio data is transmitted in real-time via the Real-Time Protocol (RTP). Due to network latency, the audio data does not arrive at the other device immediately during data transmission, resulting in a certain time difference (e.g., ...). Figure 2 (As shown in the network latency diagram), therefore, a buffer needs to be designed at the audio device receiving end. This buffer effectively isolates the audio data sender and receiver, allowing them to avoid strict real-time synchronization, but it's crucial to prevent buffer underloading / empty reads and buffer overflow / full writes as much as possible. Buffer underloading causes stuttering and discontinuity in the sound; buffer fullness leads to data loss and incompleteness, impacting the user experience. Users may experience unnatural and difficult conversations, noticeable echoes, stuttering, or poor sound quality, leading to communication anxiety and fatigue.

[0003] To address the audio quality degradation caused by network jitter during streaming, it is necessary to design a suitable playback buffer size. Currently, there are three main methods for designing the buffer depth: 1. Variance / Standard Deviation-Based Methods: While these methods can guarantee that the vast majority of data packets can be played smoothly without stuttering, they assume that network latency jitter is based on a Gaussian distribution. However, network jitter actually occurs suddenly, and the response to sudden jitter (non-Gaussian distribution) may not be fast enough.

[0004] 2. Percentile method: This method is very intuitive and allows you to set the desired percentage of network jitter that the buffer can cover. It is more resistant to the effects of extreme latency values ​​than the variance method. However, setting the size of the buffer requires maintaining a list of historical data windows at all times and sorting the data in the list in real time, which has a large performance overhead on the CPU. At the same time, it is not sensitive enough to sudden jitter.

[0005] 3. Exponential weighted average method: It does not require maintaining a historical window in the calculation of the buffer size, has high computational efficiency, and responds quickly to network latency; however, the hyperparameters must be set reasonably, as even a slight inappropriate setting can have a significant impact. Summary of the Invention

[0006] The purpose of this invention is to provide an adaptive control method, apparatus, terminal device, and medium for an audio buffer to solve the problem of poor audio data quality in the prior art.

[0007] To address the aforementioned problems, the adaptive control method for the audio buffer involved in this invention employs the following technical solution: The network latency estimate is obtained by processing each audio data packet between audio devices using a Kalman filter. The buffer estimate of the corresponding audio data packet is determined based on the preset parameter information of the audio device and the estimated network latency time of each audio data packet; The buffer estimate of the audio data packet is smoothed to obtain the corresponding buffer intermediate value; The buffer target value is obtained by performing boundary control processing on the intermediate value of the buffer through constraint conditions, and the buffer target value is used as the buffer size value of the audio data packet.

[0008] In some embodiments, processing each audio data packet between audio devices using a Kalman filter to obtain a network latency estimate includes: A state-time model and an observation model of an audio device system are pre-constructed, and a time update model and a state update model are determined based on the state-time model and the observation model; the audio device system employs a Kalman filter; Obtain the network latency observation of the audio data packets at the current moment; The network latency estimate of the audio data packet is obtained by processing the network latency observation value at the current moment based on the time update model and the state update model.

[0009] In some embodiments, the process of processing the network latency observation value at the current moment based on the time update model and the state update model to obtain the network latency estimate value of the audio data packet includes: Based on the time update model, the estimated network latency and the estimated error covariance of the previous time step are processed to obtain the predicted network latency and the updated error covariance of the current time step. The state update coefficients at the current moment are determined based on the error covariance update value at the current moment and the state update model. The estimated network latency of the audio data packet is determined based on the current state update coefficient, the current predicted network latency update value, the current observed network latency value, and the state update model.

[0010] In some embodiments, the process of processing the network latency observations at the current moment based on the time update model and the state update model to obtain the estimated network latency of the audio data packet further includes: The error covariance estimate for the current time is determined based on the state update coefficient at the current time, the error covariance update value at the current time, and the state update model. This is the error covariance estimate for the audio data packet.

[0011] In some embodiments, determining the buffer estimate of the corresponding audio data packet based on preset parameter information of the audio device and each estimated network latency time includes: The size of bytes occupied within the sampling period is determined based on the preset parameter information of the audio device; The buffer estimate for the corresponding audio data packet is determined based on the size of the bytes occupied within the sampling period and the estimated network latency of each audio data packet.

[0012] In some embodiments, the constraint is a clamping function, which includes a maximum value and a minimum value. The intermediate value of the buffer is input into the clamping function, and after the boundary control processing of the clamping function, the target value of the buffer is output.

[0013] To address the aforementioned problems, the adaptive control device for an audio buffer according to the present invention includes an audio processing module, an estimation module, a smoothing processing module, and a boundary control module; The audio processing module is used to process each audio data packet between audio devices using a Kalman filter to obtain a network latency estimate. The estimation module is used to determine the buffer estimate of the corresponding audio data packet based on the preset parameter information of the audio device and the estimated network delay time of each audio data packet; The smoothing module is used to smooth the buffer estimate of the audio data packet to obtain the corresponding buffer intermediate value; The boundary control module is used to perform boundary control processing on the intermediate value of the buffer through constraint conditions to obtain the target value of the buffer, and uses the target value of the buffer as the buffer size value of the audio data packet.

[0014] To address the aforementioned problems, the present invention provides a terminal device comprising a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the aforementioned adaptive control method for the audio buffer.

[0015] To address the aforementioned problems, the present invention relates to a computer-readable storage medium storing a computer program that, when executed on a processor, implements the aforementioned adaptive control method for the audio buffer.

[0016] The beneficial effects of this invention are as follows: The adaptive control method for the audio buffer of this invention employs a Kalman filter algorithm to predict the network latency of the next stage based on historical network latency data, thereby adaptively adjusting the size of the audio buffer in the network to ensure smooth audio data playback. Then, through smoothing control and boundary control processing, the buffer size value is made as gradual as possible, and the occurrence of extreme cases is suppressed. As a result, it has higher accuracy and sensitivity in predicting network latency and setting buffer size, further improving the audio data transmission quality between audio devices and providing users with a better user experience. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below: Figure 1 This is a schematic diagram of a voice intercom system for an embedded device. Figure 2 This is a timing diagram of the audio data transmission process; Figure 3 This is a flowchart illustrating the adaptive control method for the audio buffer in an embodiment of the present invention. Figure 4 This is a schematic diagram of the process for obtaining network latency estimates in an embodiment of the present invention. Figure 1 ; Figure 5 This is a schematic diagram of the process for obtaining network latency estimates in an embodiment of the present invention. Figure 2 ; Figure 6 This is a schematic diagram of the process for obtaining the buffer estimate in an embodiment of the present invention. Implementation To make the technical objectives, technical solutions, and beneficial effects of the present invention clearer, the technical solutions of the present invention will be further described below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only for explaining the present invention and are not intended to limit the present invention; that is, the described embodiments are merely some embodiments of the present invention, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0018] In the following text, the terms "comprising," "having," and their cognates, which may be used in various embodiments of this application, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as primarily excluding the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more combinations thereof. Furthermore, the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance.

[0019] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be construed as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.

[0020] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0021] To address the audio quality degradation caused by network jitter during streaming, a reasonable design of the buffer size is necessary. This application considers that the buffer size actually refers to the size of multiple consecutive audio data packets. However, the storage and retrieval of the buffer has a linear relationship with the time interval between data packet arrivals (network latency). The shorter the time interval between each data packet, the shorter the buffer fills up, resulting in more consistent data retrieval. Longer time intervals increase the likelihood of buffer underload. Therefore, the buffer design aims to cover the minimum buffer depth that accommodates most data packet latency fluctuations. Based on this idea, this application proposes a technique combining Kalman filtering and boundary smoothing algorithms to improve the transmission quality of audio data between handheld remote control devices in coal mines. The adaptive control method for this audio buffer is illustrated below with specific embodiments.

[0022] like Figure 3 The figure shows an adaptive control method for the audio buffer in an embodiment of the present invention. The following specific embodiments will further illustrate this method. Figure 3 The adaptive control method for the audio buffer is described in detail below. The adaptive control method for the audio buffer includes: S100 uses a Kalman filter to process audio data between audio devices to obtain an estimated network latency.

[0023] The core idea of ​​the Kalman filter is to model the system as a system containing "states" and "measurements," and then continuously correct the state variables through observations. A crucial premise of Kalman filtering is that neither state variables nor observations can accurately reflect the actual state of an object; noise will inevitably occur during the calculation process. Therefore, the Kalman filter algorithm calculates the Kalman filter gain to perform a weighted calculation of the state variables and predictions, obtaining a computational value that most closely approximates the true value.

[0024] In embodiments of the present invention, such as Figure 4 As shown, the process of using a Kalman filter to process each audio data packet between audio devices to obtain a network latency estimate includes: S110, a state-time model and an observation model of the audio equipment system are pre-built, and a time update model and a state update model are determined based on the state-time model and the observation model; the audio equipment system uses a Kalman filter.

[0025] In this embodiment of the invention, the constructed state-time model is as follows: In the formula, A represents a fixed parameter; This represents the predicted network latency at the current moment. This represents the predicted network latency value at the previous moment. This represents process noise, which generally satisfies a Gaussian noise distribution with a mean of 0 and a covariance of Q.

[0026] In this embodiment of the invention, the constructed observation model is as follows: In the formula, H represents the network latency observation, i.e., the network latency of the current audio data packet; H represents the gain of the network latency observation on the network latency prediction, which is generally a fixed value. The observed noise also follows a Gaussian noise distribution with a mean of 0 and a covariance of R.

[0027] In this embodiment of the invention, the mean square error is calculated for the state-time model and the observation model to obtain the time update model and the state update model, respectively. The time update model is as follows: In the formula, This represents the updated network delay time prediction value after adjustment based on Kalman filtering; This represents the updated error covariance value adjusted based on the Kalman filter, indicating the confidence level of this value. Initial value of the error covariance. The Kalman filtering process is... A process of continuous adjustment.

[0028] The state update model is as follows: In the formula, Represents the state update coefficients; This represents an estimated network latency. This represents the error covariance estimate; Q and R both represent Gaussian noise, with smaller values ​​indicating greater confidence in the prediction.

[0029] In this embodiment of the invention, before using the audio device system, initial parameters are set, including initial values ​​for network latency, initial values ​​for error covariance, and system parameters (such as fixed parameter A and gain H).

[0030] S120, obtain the network latency observation value of the audio data packet at the current moment.

[0031] In some embodiments, the current audio data packet is sent at time t1 and received at time t2, then the observed network latency time is... .

[0032] S130, Based on the time update model and the state update model, the network delay time observation value at the current moment is processed to obtain the estimated value of the network delay time of the audio data packet.

[0033] In this embodiment of the invention, the initial value of the network latency time is included in the initial parameters. The initial value of the error covariance is 20ms. The system parameters are set to 1, with fixed parameters A=1, gain H=1, Q=0, and R=0.2.

[0034] In some embodiments, such as Figure 5 As shown, the process of processing the network latency observations at the current moment based on the time update model and the state update model to obtain the estimated network latency of the audio data packet includes: S131, Based on the time update model, the estimated network delay time and the estimated error covariance of the previous time are processed to obtain the predicted network delay time and the updated error covariance of the current time.

[0035] In this embodiment of the invention, when the system starts up, since there is no previous moment, the initial value of the network delay time is used as the estimated value of the network delay time of the previous moment, and the initial value of the covariance is used as the estimated value of the error covariance of the previous moment.

[0036] Specifically, the calculation of the network latency prediction update value at the current moment (first moment) is as follows: That is, the network latency prediction update value at the current moment. The time interval is 20ms. The error covariance update value at the current time (first time) is calculated as follows: That is, the updated value of the error covariance at the current moment. The value is 1.

[0037] S132, determine the state update coefficients at the current time based on the error covariance update value and the state update model at the current time.

[0038] Specifically, update the value based on the error covariance at the current moment. The state update coefficients at the current time are determined by the state update equation. for: S133, determine the estimated network latency of the audio data packet based on the current state update coefficient, the current network latency prediction update value, the current network latency observation value, and the state update model.

[0039] Specifically, the coefficients are updated based on the current state. The current network latency prediction update value Current network latency observation value The state update model determines the estimated network latency of the audio data packet at the current moment. for: In this embodiment of the invention, during the process of processing the network delay time observation value at the current moment based on the time update model and the state update model to obtain the network delay time estimate at the current moment, it is also necessary to determine the error covariance estimate at the current moment, i.e., the error covariance estimate of the audio data packet, based on the state update coefficient at the current moment, the error covariance update value at the current moment, and the state update model, so that it can be continuously used for the calculation of the network delay time estimate at the next moment (the next audio data packet).

[0040] Specifically, the coefficients are updated based on the current state. The updated value of the error covariance at the current moment. The state update equation determines the error covariance estimate at the current time step. for: This invention employs a Kalman filtering algorithm to predict the network latency of the next stage based on historical network latency data, thereby adaptively adjusting the size of the network buffer to ensure smooth audio data playback.

[0041] S200 determines the buffer estimate of the corresponding audio data packet based on the preset parameter information of the audio device and the estimated network latency for each device.

[0042] In embodiments of the present invention, such as Figure 6 As shown, the process of determining the buffer estimate of the corresponding audio data packet based on the preset parameter information of the audio device and the estimated network latency time for each device includes: S210 determines the number of bytes occupied during the sampling period based on the preset parameter information of the audio device.

[0043] In this embodiment of the invention, the size of the audio data packet is typically determined by four parameters: sample length, sample channels, sample rate, and sample period. Therefore, the preset parameter information of the audio device includes sample length, sample channels, sample frequency, and sample period. Assuming a sample length of 16 bits, stereo sampling channels, a sample rate of 16kHz, and a sample period of 20ms, the size of one audio data packet within one sample period is: sample_frame = sample_length * sample_channels * 8 / 4 period_buffer = sample_frame * sample_rate * 1 / sample_period In the formula, sample_fram is the space occupied by a sampled data frame, and period_buffer is the size of bytes occupied in a sampling period.

[0044] S220, determine the buffer estimate of the corresponding audio data packet based on the size of bytes occupied within the sampling period and the estimated network delay time of each audio data packet.

[0045] In this embodiment of the invention, the estimation values ​​are based on the size of the sampling period (period_buffer) and the network latency of the audio data packets. Determine the buffer estimate for the audio data packet. for: In the formula, k is an adjustable coefficient, generally a set value greater than 0, used to increase / decrease the size of the buffer according to the delay ratio.

[0046] S300 smooths the buffer estimate of the audio data packet to obtain the buffer intermediate value.

[0047] This invention takes into account that the buffer estimate itself is noisy or affected by rapid fluctuations, and direct application will lead to frequent and drastic changes in system parameters, introducing unnecessary secondary jitter. Therefore, the buffer estimate is not directly used as the buffer size in the audio transmission process.

[0048] Low-pass filtering is used to process the buffer estimate, specifically by applying a first-order infinite impulse response rate / exponentially weighted moving average, as follows: = α * new_calculate_buffer + (1 - α) * current_buffer In the formula, The buffer size is represented by `new_calculate_buffer`; `new_calculate_buffer` represents the newly calculated intermediate value of the buffer; `current_buffer` represents the current buffer size of the audio device system, i.e., the buffer target value of the previous moment (the previous audio data packet); the smoothing factor α is a constant between 0 and 1. When α approaches 1, the filter is almost inactive. Closely following the size of new_calculate_buffer results in a fast response but may not be smooth; when α approaches 0, the filter is extremely strong. Following changes in current_buffer very slowly results in a very smooth but sluggish response; therefore, the choice of α requires a trade-off between various factors, and it is usually tried starting from around 0.1. For systems that require a fast response (such as combating sudden jitter), α can be set larger (e.g., 0.2); for systems that require extreme smoothness (such as ambient light adjustment), α can be set smaller (e.g., 0.05).

[0049] This invention, through smooth control, allows the system to have a gentle transition period, avoiding unpredictable side effects caused by sudden changes (such as audio pops or video stuttering followed by recovery). Furthermore, it reduces the user's sensitivity to abrupt, jumpy changes.

[0050] S4, by performing boundary control processing on the intermediate value of the buffer through constraint conditions, obtains the target value of the buffer, and uses the target value of the buffer as the buffer size value of the audio data packet.

[0051] In this embodiment of the invention, the constraint is a clamping function, which includes a maximum value and a minimum value. The intermediate value of the buffer is input into the clamping function, and after the boundary control processing of the clamping function, the target value of the buffer is output.

[0052] Boundary control uses a simple clamping function to force an input value (new_calculate_buffer) to be confined within a closed interval [min, max] consisting of a specified minimum and maximum value. It examines the input value new_calculate_buffer: If new_calculate_buffer is less than the minimum value min, then output min.

[0053] If new_calculate_buffer is greater than the maximum value max, then output max.

[0054] If new_calculate_buffer is between min and max, then x is output as is.

[0055] The boundary control employed in this invention is a safety barrier, ensuring that the smoothed value always remains within a reasonable range acceptable to the system and tolerable to the user, achieving the following advantages: Physical limitations: Ensure that device performance has limits (such as maximum processing power, maximum memory).

[0056] Logical constraints: Some values ​​cannot be negative by definition (such as buffer size and volume gain).

[0057] User experience: Conversations with a latency exceeding 400ms cannot proceed; it would be better to simply indicate a poor network connection. Volume that is too high causes distortion, while volume that is too low makes the audio inaudible.

[0058] This invention uses smooth control and boundary control to make the buffer size value as gradual as possible and to suppress the occurrence of extreme cases.

[0059] The adaptive control method for the audio buffer of this invention employs a Kalman filter algorithm to predict the network latency of the next stage based on historical network latency data, thereby adaptively adjusting the size of the audio buffer in the network to ensure smooth audio data playback. Then, through smoothing control and boundary control processing, the buffer size value is made as gradual as possible, and the occurrence of extreme cases is suppressed. As a result, it has higher accuracy and sensitivity in predicting network latency and setting buffer size, further improving the audio data transmission quality between audio devices and providing users with a better user experience.

[0060] The adaptive control device for the audio buffer will be described below with reference to some specific embodiments.

[0061] The adaptive control device for the audio buffer in this embodiment of the invention includes an audio processing module, an estimation module, a smoothing module, and a boundary control module. The audio processing module is used to process each audio data packet between audio devices using a Kalman filter to obtain a network latency estimate. The estimation module is used to determine the buffer estimate of the corresponding audio data packet based on the preset parameter information of the audio devices and the network latency estimate of each audio data packet. The smoothing module is used to smooth the buffer estimate of the audio data packet to obtain the intermediate value of the corresponding buffer. The boundary control module is used to perform boundary control processing on the intermediate value of the buffer through constraints to obtain the target value of the buffer, and uses the target value of the buffer as the buffer size value of the audio data packet.

[0062] This application also provides a terminal device, exemplary of which includes a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to cause the terminal device to perform the above-described adaptive control method for the audio buffer.

[0063] The processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including at least one of a Central Processing Unit (CPU), Graphics Processing Unit (GPU), Network Processor (NP), Digital Signal Processor (DSP), Application-Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application.

[0064] The memory can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), and Electrically Erasable Programmable Read-Only Memory (EEPROM). The memory stores computer programs, and the processor, upon receiving execution instructions, can execute the computer programs accordingly.

[0065] This application also provides a computer-readable storage medium for storing the computer program used in the aforementioned terminal device. For example, the computer-readable storage medium may include, but is not limited to, various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0066] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that, in alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0067] In addition, the functional modules or units in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0068] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a 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 smartphone, personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.

[0069] Finally, it should be noted that the above embodiments are only for illustration and not for limiting the technical solutions of the present invention. Any equivalent substitutions, modifications or partial substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. An adaptive control method for an audio buffer, characterized in that, include: The network latency estimate is obtained by processing each audio data packet between audio devices using a Kalman filter. The buffer estimate of the corresponding audio data packet is determined based on the preset parameter information of the audio device and the estimated network latency time of each audio data packet; The buffer estimate of the audio data packet is smoothed to obtain the corresponding buffer intermediate value; The buffer target value is obtained by performing boundary control processing on the intermediate value of the buffer through constraint conditions, and the buffer target value is used as the buffer size value of the audio data packet.

2. The adaptive control method for the audio buffer according to claim 1, characterized in that, The process of using a Kalman filter to process each audio data packet between audio devices to obtain a network latency estimate includes: A state-time model and an observation model of an audio device system are pre-constructed, and a time update model and a state update model are determined based on the state-time model and the observation model; the audio device system employs a Kalman filter; Obtain the network latency observation of the audio data packets at the current moment; The network latency estimate of the audio data packet is obtained by processing the network latency observation value at the current moment based on the time update model and the state update model.

3. The adaptive control method for the audio buffer according to claim 2, characterized in that, The process of processing the network latency observations at the current moment based on the time update model and the state update model to obtain the estimated network latency of the audio data packet includes: Based on the time update model, the estimated network latency and the estimated error covariance of the previous time step are processed to obtain the predicted network latency and the updated error covariance of the current time step. The state update coefficients at the current moment are determined based on the error covariance update value at the current moment and the state update model. The estimated network latency of the audio data packet is determined based on the current state update coefficient, the current predicted network latency update value, the current observed network latency value, and the state update model.

4. The adaptive control method for the audio buffer according to claim 3, characterized in that, The process of processing the network latency observations at the current moment based on the time update model and the state update model to obtain the estimated network latency of the audio data packet further includes: The error covariance estimate for the current time is determined based on the state update coefficient at the current time, the error covariance update value at the current time, and the state update model. This is the error covariance estimate for the audio data packet.

5. The adaptive control method for the audio buffer according to claim 1 or 4, characterized in that, The step of determining the buffer estimate of the corresponding audio data packet based on the preset parameter information of the audio device and the estimated network latency for each data packet includes: The size of bytes occupied within the sampling period is determined based on the preset parameter information of the audio device; The buffer estimate for the corresponding audio data packet is determined based on the size of the bytes occupied within the sampling period and the estimated network latency of each audio data packet.

6. The adaptive control method for the audio buffer according to claim 1 or 4, characterized in that, The constraint is a clamping function, which includes a maximum value and a minimum value. The intermediate value of the buffer is input into the clamping function, and after the boundary control processing of the clamping function, the target value of the buffer is output.

7. An adaptive control device for an audio buffer, characterized in that, It includes an audio processing module, an estimation module, a smoothing module, and a boundary control module; The audio processing module is used to process each audio data packet between audio devices using a Kalman filter to obtain a network latency estimate. The estimation module is used to determine the buffer estimate of the corresponding audio data packet based on the preset parameter information of the audio device and the estimated network delay time of each audio data packet; The smoothing module is used to smooth the buffer estimate of the audio data packet to obtain the corresponding buffer intermediate value; The boundary control module is used to perform boundary control processing on the intermediate value of the buffer through constraint conditions to obtain the target value of the buffer, and uses the target value of the buffer as the buffer size value of the audio data packet.

8. A terminal device, characterized in that, The terminal device includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the adaptive control method for the audio buffer according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed on a processor, implements the adaptive control method for the audio buffer according to any one of claims 1-6.