Audio cache adjustment method and device, wireless audio equipment and medium

By detecting the packet reception interval and historical buffer values ​​of wireless audio devices, the audio buffer size is dynamically adjusted, solving the problem of audio-visual asynchrony or stuttering in wireless devices under interference environments, and achieving low latency and stable playback.

CN121126431APending Publication Date: 2025-12-12VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511273576.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-08
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Wireless devices often struggle to simultaneously deliver low latency and stable audio playback under varying interference environments, leading to audio-visual desynchronization or stuttering issues.

Method used

By detecting the packet reception interval and historical buffer values ​​of wireless audio devices, the audio buffer size is dynamically calculated and adjusted, and adaptive adjustment is performed in combination with Bluetooth packet transmission characteristics to achieve interference detection and buffer optimization.

Benefits of technology

It improves the audio stuttering problem of wireless devices under different interference scenarios, ensuring low latency and stable playback for users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121126431A_ABST
    Figure CN121126431A_ABST
Patent Text Reader

Abstract

The invention discloses an audio cache adjustment method and device, wireless audio equipment and a medium, and belongs to the technical field of wireless communication. The method comprises the following steps: the wireless audio equipment detects N packet receiving intervals before the nth moment; the packet receiving interval is a time interval between receiving moments of two adjacent audio data frames; the wireless audio equipment determines a target value of the audio cache at the nth moment according to the N packet receiving intervals and a historical value of the audio cache; n is an integer greater than 0; and the wireless audio equipment adjusts the size of the audio cache at the nth moment to the target value.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of wireless communication, and particularly relates to an audio buffer adjustment method and device, a wireless audio device and a medium. BACKGROUND

[0002] With the popularity of wireless devices, more and more users will use mobile phones to connect wireless earphones, wireless sound boxes, wireless watches, wireless smart glasses and other devices to listen to music and play games. Compared with wired devices, wireless devices can bring users a more free and comfortable entertainment experience.

[0003] In an audio playing scene, a wireless device stores real-time received audio data in a buffer area and sends the data to a loudspeaker in sequence for playing. If the buffer area is set too large, the screen of the mobile phone and the audio may have a large delay, resulting in an out-of-sync experience. If the buffer area is set too small, when the environmental interference becomes large, the buffer cannot be filled in time, resulting in no data available for playing in the loudspeaker and an audio lag experience.

[0004] Most of the current wireless devices use Bluetooth or wifi communication, and Bluetooth devices account for a larger proportion. The communication mode mainly works in the 2.4GISM (Industry Science Medicine) frequency band, which is a publicly used wireless frequency band worldwide. It is easily interfered by 2.4g wifi routers, Bluetooth devices and other electronic devices using the same frequency band. Such interference may cause a decrease in signal quality, thereby affecting the connection ability of the device. The size of such interference is affected by many factors, including the strength of the same frequency signal near the location, the wifi and Bluetooth transmission scheduling strategies of different terminal communication chips, the antenna polarization direction and power of the transmitting device and the receiving device. Many interference factors make it difficult for a wireless receiving device to determine a fixed audio buffer to simultaneously ensure the low delay experience and stable experience of the user. SUMMARY

[0005] The purpose of the embodiments of the application is to provide an audio buffer adjustment method, device, wireless audio device and medium, which can solve the problem that a fixed audio buffer cannot simultaneously ensure the low delay experience and stable experience of the user.

[0006] In a first aspect, the embodiments of the application provide an audio buffer adjustment method, which comprises:

[0007] The wireless audio device detects N packet receiving intervals before the nth moment; the packet receiving interval is the time interval between the receiving moments of two adjacent audio data frames;

[0008] The wireless audio device determines a target value of the audio buffer at the nth moment according to the N packet receiving intervals and a historical value of the audio buffer; n is an integer greater than 0;

[0009] The wireless audio device adjusts the size of the audio buffer at the nth moment to the target value.

[0010] In a second aspect, an embodiment of the present application provides an audio buffer adjustment device, the device comprising:

[0011] The detection module is configured to detect N packet receiving intervals before the nth moment; the packet receiving interval is a time interval between receiving moments of two adjacent audio data frames;

[0012] The determination module is configured to determine a target value of the audio buffer at the nth moment according to the N packet receiving intervals and a historical value of the audio buffer; n is an integer greater than 0;

[0013] The adjustment module is configured to adjust the size of the audio buffer at the nth moment to the target value.

[0014] In a third aspect, an embodiment of the present application provides a wireless audio device, which comprises a processor and a memory, the memory stores programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement the steps of the method according to the first aspect.

[0015] In a fourth aspect, an embodiment of the present application provides a readable storage medium, which stores programs or instructions, and the programs or instructions are executed by a processor to implement the steps of the method according to the first aspect.

[0016] In a fifth aspect, an embodiment of the present application provides a chip, which comprises a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute programs or instructions to implement the method according to the first aspect.

[0017] In a sixth aspect, an embodiment of the present application provides a computer program product stored in a storage medium, and the program product is executed by at least one processor to implement the method according to the first aspect.

[0018] In the embodiments of the present application, the wireless audio device dynamically calculates and adjusts the audio buffer of the wireless audio device according to the packet receiving intervals and the historical value of the audio buffer, which can realize interference detection and adaptive audio buffer adjustment at the wireless audio device end, improve the problem that the wireless audio device is prone to sound lag in different interference scenarios, and thus can ensure the low-latency experience and stable experience of users at the same time. BRIEF DESCRIPTION OF DRAWINGS

[0019] Figure 1 a step flow chart representing an audio buffer adjustment method provided by an embodiment of the present application;

[0020] Figure 2 one of the application example diagrams representing an audio buffer adjustment method provided by an embodiment of the present application;

[0021] Figure 3 the second of the application example diagrams representing an audio buffer adjustment method provided by an embodiment of the present application;

[0022] Figure 4 the third of the application example diagrams representing an audio buffer adjustment method provided by an embodiment of the present application;

[0023] Figure 5 a structural schematic diagram of an audio buffer adjustment apparatus provided by an embodiment of the present application;

[0024] Figure 6 a structural schematic diagram of a wireless audio device provided by an embodiment of the present application;

[0025] Figure 7 a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0026] The technical solutions in the embodiments of the present application will be described clearly below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.

[0027] The terms “first”, “second”, and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by “first”, “second”, etc. are generally of a kind and do not limit the number of objects, for example, the first object can be one or more. In addition, “and / or” in the specification and claims indicates at least one of the connected objects, and the character “ / ” generally indicates that the objects before and after are in an “or” relationship.

[0028] The audio buffer adjustment method provided by the embodiments of the present application will be described in detail below in conjunction with the drawings, specific embodiments and application scenarios.

[0029] As shown in Figure 1 The present application provides an audio buffer adjustment method, which comprises:

[0030] In step 101, the wireless audio device detects N packet receiving intervals before the nth moment; the packet receiving interval is a time interval between receiving moments of two adjacent audio data frames.

[0031] For example, as shown in FIG. 1, the audio sending device transmits an audio data frame to the wireless audio device through wireless transmission; the wireless audio device receives the audio data frame through Bluetooth and stores the audio data frame in an audio buffer. Figure 2 Figure 3 For example, as shown in FIG. 1, the audio sending device transmits an audio data frame to the wireless audio device through wireless transmission; the wireless audio device receives the audio data frame through Bluetooth and stores the audio data frame in an audio buffer.

[0032] In step 102, the wireless audio device determines a target value of the audio buffer at the nth moment according to the N packet receiving intervals and historical values of the audio buffer; n is an integer greater than 0.

[0033] In an implementation, in the case that the N packet receiving intervals are not equal, the wireless audio device can determine that the current environmental interference has changed and the audio buffer value should be adjusted in time; in this case, the wireless audio device determines the target value of the audio buffer at the nth moment according to the N packet receiving intervals and historical values of the audio buffer.

[0034] For example, when the signal of the audio sending device is poor or the audio sending device has started 2.4g wifi, which competes with the transmission time slot of Bluetooth, the Bluetooth of the audio sending device may have unstable packet sending intervals, at this time, the data received by the wireless audio device end may have large intervals, resulting in audio stuttering and discontinuity; in this case, the N packet receiving intervals detected in step 101 are not equal.

[0035] In step 103, the wireless audio device adjusts the size of the audio buffer at the nth moment to the target value.

[0036] In the embodiments of the present application, the wireless audio device dynamically calculates and adjusts the audio buffer of the wireless audio device according to the packet receiving intervals and historical values of the audio buffer, which can realize interference detection and adaptive audio buffer adjustment of the wireless audio device end, improve the problem that the wireless audio device is prone to audio stuttering in different interference scenarios, and thus can ensure low latency experience and stable experience of the user.

[0037] The embodiments of the present application quantitatively evaluate external interference through the algorithm detection part of the wireless audio device to obtain the input value of the control algorithm, then transmit the N packet receiving intervals obtained by detection to the control part of the algorithm, and obtain the theoretically optimal audio buffer (i.e., the target value) under the current interference through calculation, so as to ensure the anti-interference ability and low delay characteristics of the audio.

[0038] It should be noted that the characteristics of Bluetooth packet sending include:

[0039] ​(1) In an ideal environment, the Bluetooth packet sending interval should be uniform and stable.

[0040] (2) When the audio sending end Bluetooth has a large interval between the sending time of a certain audio data packet and the sending time of the previous audio data packet, in order to compensate for the audio data packets that are not sent in time, multiple audio data packets with small intervals will be continuously sent in a short time to ensure the stability of the average number of packets sent per unit time.

[0041] (3) When interference occurs, the Bluetooth packet sending may not immediately increase, which depends on the scheduling strategy of the audio sending end. Therefore, if there is a large interval between packets, it means that the interference has reached a certain strength, and subsequent large interval packets may occur multiple times.

[0042] (4) Due to different scheduling strategies, the packet sending may be a mixture of large intervals, small intervals, and normal intervals. Therefore, when the packet sending interval is normal, it does not necessarily mean that it is out of the interference environment.

[0043] In at least one embodiment of the present application, step 101 comprises:

[0044] The wireless audio device detects the receiving time of a plurality of audio data frames before the nth moment; wherein the receiving time of the audio data frame is the time when the wireless audio device stores the audio data frame into the audio cache;

[0045] The wireless audio device determines the N packet receiving intervals according to the receiving time of the plurality of audio data frames.

[0046] In an embodiment of the present application, considering that the audio transmission link from the audio sending end to the wireless audio device is relatively long, the detection position of environmental interference is as close to the end of the link as possible to cover the influence of multiple links (network, audio sending end sending, air transmission, wireless audio device receiving). In an embodiment of the present application, detection is performed at the time when the wireless audio device puts the audio data frame into the audio cache each time, and the packet receiving interval of the wireless audio device receiving the audio data frame is obtained, which is recorded as diff_time.

[0047] If the value of diff_time is relatively close each time, it means that the wireless audio device can stably receive the audio data packet at this time, and the external environmental interference is small, as shown in Figure 2 .

[0048] If the value of diff_time changes greatly each time, it means that the wireless audio device cannot stably receive the audio data at this time, and the external environmental interference is large, which has the risk of stuttering, as shown in Figure 3 .

[0049] Taking the packet sending of the wireless audio device in the game mode as an example, in the case of less environmental interference, the diff_time should be stable at about 12 ms each time, and when the wifi interference occurs, the diff_time may increase to 40-50 ms.

[0050] By counting the diff_time, the environmental interference can be quantified preliminarily. Considering the characteristics (1) and (2) of Bluetooth, when the environmental interference in a period of time needs to be counted, some small diff_time will affect the final statistical result, therefore, a weighted calculation method of diff_time is adopted in the embodiment of the application to evaluate the environmental interference in a period of time.

[0051]

[0052] Here, average_time represents the Bluetooth packet sending interval in an ideal environment, is a weight value, when the diff_time i is larger, the weight value is larger, which means that the large packet receiving interval will be paid more attention to, and the small diff_time i will not affect the final result too much. This calculation method can better highlight the influence of interference.

[0053] The embodiment of the application evaluates the environmental interference by counting the packet receiving interval at the wireless audio device. The evaluation index can cover the influence of the transmitting end interval, the air transmission interference, the receiving strength of the receiving end and the scheduling of the receiving device itself. At the same time, the Bluetooth packet is usually sent continuously for a short time after experiencing a large interval delay to make up for it, in order not to let these short interval packets affect the interference evaluation, a weighted calculation method is adopted to calculate the packet receiving interval.

[0054] In at least one embodiment of the application, step 102 comprises:

[0055] performing weighted calculation on the N packet receiving intervals to obtain a first value;

[0056] taking the maximum value of the N packet receiving intervals as a second value;

[0057] taking the audio buffer value at the n-1 moment in the history value of the audio buffer as a third value;

[0058] determining the target value of the audio buffer at the n moment according to the first value, the second value and the third value.

[0059] Optionally, the first value can also be referred to as a current value, i.e., an interference statistical value in a period of time, in order to exclude the rapid compensation of Bluetooth after packet sending in an abnormal interval, a weighted calculation value weighted_average_time of the packet receiving interval can be used to represent, and this part of function is controlled by the current value; specifically, the N packet receiving intervals are weighted calculated to obtain the first value, including:

[0060] According to the N packet receiving intervals and the first formula, the first value is determined; wherein the first formula is:

[0061]

[0062] Wherein, now n is the first value; average_time is a preset packet receiving interval; diff_time i is the i th packet receiving interval; N is the number of packet receiving intervals.

[0063] Optionally, average_time is the uniform packet receiving interval in the ideal case, the first formula will amplify the weight of large interval and reduce the weight of small packet sending interval, so as to better highlight the influence of interference.

[0064] Optionally, the second value can also be referred to as a predicted value, according to the Bluetooth characteristic (3), when a large interval packet appears, it means that it has entered the interference scene, and subsequent large interval packets may continue to appear, at this time, the audio buffer value of the earphone end needs to be quickly increased to avoid the card sound caused by the consumption of the buffer, this part of function is controlled by the predicted value, and the specific formula is:

[0065]

[0066] Wherein, future n is the second value (or predicted value); diff_time i is the i th packet receiving interval, and N is the number of packet receiving intervals.

[0067] Optionally, the third value can also be referred to as a past value, according to the Bluetooth characteristic (3), when the packet receiving interval is reduced, the audio buffer needs to be slowly reduced, and only when the long-term stable packet receiving interval is obtained, it can be considered that it has left the interference environment, this part of function is controlled by the past value, and the specific formula is:

[0068] past n =dest_mtu n-1

[0069] Wherein, past n is the third value (or past value); dest_mtu n-1 is the value of the audio buffer at the n-1 th moment.

[0070] Optionally, the initial value of the audio buffer can be set to:

[0071] dest_mtu0=(dest_mtu low +dest_mtu high ) / 2

[0072] Among them, dest_mtu low and dest_mtu high Adjusting the lower and upper limits of the set audio buffer helps the audio buffer converge quickly.

[0073] Accordingly, based on the first value, the second value, and the third value, the target value of the audio buffer at time n is determined, including:

[0074] Based on the first value, the second value, the third value, and the second formula, the target value of the audio buffer at time n is determined; wherein, the second formula is:

[0075] dest_mtu n =K n *now n +K f *future n +K p *past n

[0076] Among them, now n As the first value, future n The second value, past n K is the third value. n The weight of the first value, K f K is the weight of the second value. p The weight of the third value; K n +K f +K p =1.

[0077] For example, such as Figure 4 As shown, the mobile phone transmits audio data frames to the headset (i.e., the wireless audio device) via a wireless transmission link; the headset determines the reception interval diff_time of the audio data frames; and the headset's algorithm control part determines the current value now based on the reception interval diff_time. n Predicted value future n and past values n And based on the current value now n Predicted value future n and past values n Determine the target cache dest_mtu for the audio cache.n .

[0078] The real-time calculation using the second formula above reflects the impact of the packet reception interval on the audio buffer value across different dimensions. K n ,K f ,K p These are the weights for the current value, the predicted value, and the past value, respectively. The weights determine the influence of these three values ​​when calculating the target value of the audio buffer, and can be set according to the desired adjustment curve.

[0079] For example, if you want to speed up the cache rise when interference increases, you need to increase the weight K of the predicted value. f To accelerate cache decay during periods of reduced interference, the weight K of past values ​​needs to be increased. p To increase the impact of the current value, increase K. n The value of .

[0080] In at least one embodiment of this application, step 103 includes:

[0081] The wireless audio device adjusts the size of the audio buffer at time n to the target value by adjusting the playback speed of the audio stream in the audio buffer.

[0082] For example, when the audio buffer value changes, the wireless audio device can adjust the playback speed of the audio stream by software resampling at the decoder or by changing the hardware playback speed at the DAC, thereby making the actual audio buffer value quickly approach the target value of the audio buffer.

[0083] It should be noted that under normal usage scenarios, when wireless audio devices detect a stable and uniform reception interval, they will use a lower audio buffer for transmission, ensuring stable transmission while providing users with an extremely low transmission latency experience. However, in scenarios with interference, the detection mechanism in this application can identify interference risks throughout the entire link and, based on the characteristics of Bluetooth packet transmission, adjust the audio buffer according to multiple dimensions. This allows for a rapid increase and slow decrease in interference levels, while also providing a certain degree of predictive capability.

[0084] In summary, this application embodiment, taking into account the characteristics of Bluetooth packet transmission, aims to ensure a rapid increase followed by a slow decrease in the adjustment trend, while also considering short-term future trends. The control method simultaneously considers changes in three dimensions: current value, past cumulative value, and future predicted value. A novel audio buffer adjustment mechanism is designed to achieve an ideal buffer adjustment curve. Compared to traditional segmented adjustment, this method achieves higher adjustment precision while ensuring audio stability and low latency.

[0085] The audio buffer adjustment method provided in the embodiments of the present application can be executed by an audio buffer adjustment device. The audio buffer adjustment device is taken as an example to illustrate the audio buffer adjustment method provided in the embodiments of the present application.

[0086] As shown in Figure 5 The embodiments of the present application further provide an audio buffer adjustment device 500, which comprises:

[0087] A detection module 501 is configured to detect N packet receiving intervals before the nth moment; the packet receiving interval is a time interval between receiving moments of two adjacent audio data frames;

[0088] A determination module 502 is configured to determine a target value of the audio buffer at the nth moment according to the N packet receiving intervals and a historical value of the audio buffer; n is an integer greater than 0;

[0089] An adjustment module 503 is configured to adjust a size of the audio buffer at the nth moment to the target value.

[0090] In some embodiments of the present application, the detection module comprises:

[0091] A detection sub-module is configured to detect receiving moments of a plurality of audio data frames before the nth moment; wherein the receiving moment of the audio data frame is a moment when the wireless audio device stores the audio data frame into the audio buffer;

[0092] A first determination sub-module is configured to determine the N packet receiving intervals according to the receiving moments of the plurality of audio data frames.

[0093] In some embodiments of the present application, the determination module comprises:

[0094] A second determination sub-module is configured to perform weighted calculation on the N packet receiving intervals to obtain a first value;

[0095] The second determination sub-module is configured to take a maximum value of the N packet receiving intervals as a second value;

[0096] A third determination sub-module is configured to take an audio buffer value at the (n-1)th moment in the historical value of the audio buffer as a third value;

[0097] A fourth determination sub-module is configured to determine a target value of the audio buffer at the nth moment according to the first value, the second value and the third value.

[0098] In some embodiments of the present application, the second determination sub-module comprises:

[0099] The first determining unit is configured to determine a first value according to the N packet receiving intervals and a first formula, wherein the first formula is:

[0100]

[0101] wherein now n is the first value, average_time is a preset packet receiving interval, diff_time i is the ith packet receiving interval, and N is the number of the packet receiving intervals.

[0102] In some embodiments of the present application, the fourth determining sub-module comprises:

[0103] The second determining unit is configured to determine a target value of the audio buffer at the nth moment according to the first value, the second value, the third value and a second formula, wherein the second formula is:

[0104] dest_mtu n = K n *now n + K f *future n + K p *past n

[0105] wherein now n is the first value, future n is the second value, past n is the third value, K n is a weight of the first value, K f is a weight of the second value, K p is a weight of the third value, K n + K f + K p = 1.

[0106] In some embodiments of the present application, the adjusting module comprises:

[0107] The adjusting sub-module is configured to adjust the size of the audio buffer at the nth moment to the target value by adjusting the playing speed of the audio stream in the audio buffer.

[0108] The embodiments of the present application can detect environmental interference under the condition of environmental change, dynamically calculate and adjust the audio buffer of the wireless device, thereby improving the audio blocking of the wireless device. In an ideal scenario, the buffer can be reduced to ensure an extreme low-latency experience, and in some extreme scenarios, the buffer value required to resist interference is calculated to improve the audio blocking and improve the experience of using the wireless device for calling, music, video watching and the like.

[0109] The audio buffer adjustment apparatus in the embodiments of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other device than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or the like, and can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, and the like, and the embodiments of the present application are not limited in this regard.

[0110] The audio buffer adjustment apparatus in the embodiments of the present application can be a device with an operating system. The operating system can be an Android operating system, an ios operating system, or other possible operating system, and the embodiments of the present application are not limited in this regard.

[0111] The audio buffer adjustment apparatus provided in the embodiments of the present application can implement Figures 1 to 4 The method embodiments implement various processes, and to avoid repetition, the details are not described herein.

[0112] Optionally, as shown in Figure 6 The embodiments of the present application also provide a wireless audio device 600, which includes a processor 601 and a memory 602, and the memory 602 stores programs or instructions that can run on the processor 601. When the programs or instructions are executed by the processor 601, various steps of the above-mentioned audio buffer adjustment method embodiments are implemented, and the same technical effects are achieved. To avoid repetition, the details are not described herein.

[0113] It should be noted that the electronic device in the embodiments of the present application includes the mobile electronic device and the non-mobile electronic device.

[0114] Figure 7 A hardware structure diagram of an electronic device according to an embodiment of the present application is shown. The electronic device is a wireless audio device.

[0115] The electronic device 700 includes, but is not limited to, a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710, etc.

[0116] Those skilled in the art can understand that the electronic device 700 can further include a power supply (such as a battery) for supplying power to each component, and the power supply can be logically connected to the processor 710 through a power management system, so that the power management system can realize functions such as management of charging, discharging, and power consumption management. Figure 7 The electronic device structure shown in the figure is not a limitation on the electronic device, and the electronic device can include more or fewer components than shown, or combine certain components, or different component arrangements, which will not be described here.

[0117] The processor 710 is configured to detect N packet receiving intervals before the nth moment; the packet receiving interval is a time interval between receiving moments of two adjacent audio data frames; determine a target value of the audio buffer at the nth moment according to the N packet receiving intervals and a historical value of the audio buffer; n is an integer greater than 0; and adjust the size of the audio buffer at the nth moment to the target value.

[0118] The application embodiment combines the characteristics of Bluetooth packet sending, and the adjustment trend should ensure rapid rise and slow decline, while considering the future short-term trend. The control method changes from the current value, the past cumulative value, and the future predicted value three dimensions, and a new audio buffer adjustment method is designed to realize the ideal buffer adjustment curve, which can achieve higher adjustment accuracy compared to the traditional segmented adjustment, while ensuring the stability and low delay of the audio.

[0119] It should be understood that in the embodiments of the present application, the input unit 704 can include a graphics processor (GPU) 7041 and a microphone 7042. The graphics processor 7041 processes image data of a still picture or a video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 706 can include a display panel 7061, which can be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 707 includes at least one of a touch panel 7071 and other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 can include a touch detection device and a touch controller. The other input devices 7072 can include, but are not limited to, a physical keyboard, function keys (such as volume control keys, on-off keys, etc.), trackballs, mice, joysticks, etc., which will not be described here.

[0120] The memory 709 can be used to store software programs and various data. The memory 709 can mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area can store an operating system, application programs or instructions required by at least one function (such as a sound playing function, an image playing function, etc.), and the like. In addition, the memory 709 can include a volatile memory or a non-volatile memory, or the memory 709 can include both a volatile memory and a non-volatile memory. The non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM), a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), an Enhanced SDRAM (ESDRAM), a Synch link DRAM (SLDRAM), and a Direct Rambus RAM (DRRAM). The memory 709 in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.

[0121] The processor 710 can include one or more processing units; optionally, the processor 710 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and an application program, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 710.

[0122] The embodiments of the present application also provide a readable storage medium, the readable storage medium stores programs or instructions, the programs or instructions are executed by a processor to realize the processes of the above-mentioned audio buffer adjustment method embodiments, and the same technical effects can be achieved. To avoid repetition, details are not described here.

[0123] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0124] The embodiment of the present application further provides a chip, which comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running programs or instructions to realize the processes of the above audio buffer adjustment method embodiments and achieve the same technical effects. To avoid repetition, details are not described herein.

[0125] It should be understood that the chip mentioned in the embodiment of the present application can also be referred to as a system on chip (SoC), a system chip, a chip system or a system on chip (SoC), etc.

[0126] The embodiment of the present application provides a computer program product, which is stored in a storage medium, and is executed by at least one processor to realize the processes of the above audio buffer adjustment method embodiments and achieve the same technical effects. To avoid repetition, details are not described herein.

[0127] It should be noted that in this document, the term "comprise", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprises a" does not exclude the presence of additional identical elements in the process, method, article or device comprising the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to the order of performing functions as shown or discussed, but can also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method can be performed in an order different from the described order, and various steps can also be added, omitted or combined. In addition, the features described with reference to some examples can be combined in other examples.

[0128] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned example methods can be realized by means of software and a necessary general hardware platform, and of course, can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product in essence or in the form of a part that contributes to the prior art, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) and includes a plurality of instructions for causing a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application.

[0129] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative and not restrictive. Those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the scope protected by the claims.

Claims

1. An audio buffer adjustment method, characterized in that, The method includes: The wireless audio device detects N packet reception intervals before time n; the packet reception interval is the time interval between the reception times of two adjacent audio data frames; The wireless audio device determines the target value of the audio buffer at time n based on the N packet reception intervals and the historical value of the audio buffer; n is an integer greater than 0. The wireless audio device adjusts the size of the audio buffer at time n to the target value.

2. The method according to claim 1, characterized in that, The wireless audio device detects N packet reception intervals before time n, including: The wireless audio device detects the reception times of multiple audio data frames prior to time n; wherein, the reception time of the audio data frame is the time when the wireless audio device stores the audio data frame into the audio buffer; The wireless audio device determines the N packet reception intervals based on the reception times of the plurality of audio data frames.

3. The method according to claim 1 or 2, characterized in that, The wireless audio device determines the target value of the audio buffer at time n based on the N packet reception intervals and the historical values ​​of the audio buffer, including: The first value is obtained by weighting the N packet receiving intervals; The maximum value of the N packet receiving intervals is taken as the second value; The audio cache value at time n-1 in the historical values ​​of the audio cache is used as the third value; The target value of the audio buffer at time n is determined based on the first value, the second value, and the third value.

4. The method according to claim 3, characterized in that, The first value is obtained by weighting the N packet receiving intervals, including: Based on the N packet receiving intervals and the first formula, a first value is determined; wherein, the first formula is: Among them, now n The first value is used; average_time is the preset packet reception interval; diff_time is the first value. i Let be the i-th packet receiving interval; N is the number of packet receiving intervals.

5. The method according to claim 3, characterized in that, Based on the first value, the second value, and the third value, the target value of the audio buffer at time n is determined, including: Based on the first value, the second value, the third value, and the second formula, the target value of the audio buffer at time n is determined; wherein, the second formula is: dest_mtu n =K n *now n +K f future n +K p *past n Among them, now n As the first value, future n The second value, past n K is the third value. n The weight of the first value, K f K is the weight of the second value. p The weight of the third value; K n +K f +K p =1.

6. The method according to any one of claims 1-5, characterized in that, The wireless audio device adjusts the size of the audio buffer at time n to the target value, including: The wireless audio device adjusts the size of the audio buffer at time n to the target value by adjusting the playback speed of the audio stream in the audio buffer.

7. An audio buffer adjustment device, characterized in that, The device includes: The detection module is used to detect N packet reception intervals before the nth time; the packet reception interval is the time interval between the reception times of two adjacent audio data frames; The determination module is used to determine the target value of the audio buffer at time n based on the N packet reception intervals and the historical values ​​of the audio buffer; n is an integer greater than 0. An adjustment module is used to adjust the size of the audio buffer at time n to the target value.

8. The apparatus according to claim 7, characterized in that, The detection module includes: The detection submodule is used to detect the reception times of multiple audio data frames before the nth time; wherein, the reception time of the audio data frame is the time when the audio data frame is stored in the audio buffer; The first determining submodule is used to determine the N packet receiving intervals based on the receiving times of the plurality of audio data frames.

9. The apparatus according to claim 7 or 8, characterized in that, The determining module includes: The second determining submodule is used to perform a weighted calculation on the N packet receiving intervals to obtain a first value; The second determining submodule is used to take the maximum value of the N packet receiving intervals as the second value; The third determining submodule is used to take the audio cache value at time n-1 from the historical values ​​of the audio cache as the third value; The fourth determining submodule is used to determine the target value of the audio buffer at time n based on the first value, the second value, and the third value.

10. The apparatus according to claim 9, characterized in that, The second determining submodule includes: The first determining unit is configured to determine a first value based on the N packet receiving intervals and a first formula; wherein the first formula is: Among them, now n The first value is used; average_time is the preset packet reception interval; diff_time is the first value. i Let be the i-th packet receiving interval; N is the number of packet receiving intervals.

11. The apparatus according to claim 9, characterized in that, The fourth determining submodule includes: The second determining unit is configured to determine the target value of the audio buffer at time n based on the first value, the second value, the third value, and the second formula; wherein the second formula is: dest_mtu n =K n *now n +K f future n +K p *past n Among them, now n As the first value, future n The second value, past n K is the third value. n The weight of the first value, K f K is the weight of the second value. p The weight of the third value; K n +K f +K p =1.

12. The apparatus according to any one of claims 7-11, characterized in that, The adjustment module includes: The adjustment submodule is used to adjust the size of the audio buffer at time n to the target value by adjusting the playback speed of the audio stream in the audio buffer.

13. A wireless audio device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the audio buffer adjustment method as described in any one of claims 1-6.

14. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the audio buffer adjustment method as described in any one of claims 1-6.