A method for playing Bluetooth audio, a storage medium, and a true wireless headset

By receiving Bluetooth audio data frames in true wireless headphones and decoding when the preset threshold is reached, the problem of audio playback delay of true wireless headphones in the prior art is solved, and the effect of reducing delay and improving user experience is achieved.

CN115038002BActive Publication Date: 2025-06-24BESTECHNIC SHANGHAI CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210586899.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-26
Publication Date
2025-06-24
Estimated Expiration
2042-05-26

AI Technical Summary

Technical Problem

Existing true wireless headphones have delay problems during audio playback, which affects the user's user experience.

Method used

By receiving data frames of Bluetooth audio, the data frame number is detected to detect whether the number of data frames reaches the preset threshold, and decodes in sequence when the threshold is reached, and the playback time is determined, and the playback time is not performed until the playback time reaches.

Benefits of technology

When the playback time reaches, the decoded data frame can be directly played, which reduces the overall delay in audio playback and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115038002B_ABST
    Figure CN115038002B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method for playing Bluetooth audio, a storage medium, and true wireless earphones. The method includes: receiving a data frame of Bluetooth audio and detecting whether the number of data frames received currently has reached a preset threshold; when the number of data frames received currently reaches the preset threshold, decoding the received data frames in sequence and determining the playback time according to the decoding situation of the data frames; when the playback time is reached, playing the decoded data frames in sequence. During the process of playing Bluetooth audio, the present disclosure starts to perform related operations of decoding the received data frames in sequence when a certain amount of data frames are received, completes the decoding of the data frames during the waiting for the playback time to arrive, and realizes that the decoded data frames can be directly played when the playback time arrives, thereby achieving the effect of reducing the overall delay and improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of display technologies, and particularly to a method for playing Bluetooth audio, a storage medium, and a true wireless headset. Background Art

[0002] With the development and popularization of Bluetooth true wireless (TWS, True wireless stereo) technology, more and more users will choose TWS headsets when selecting headsets. For certain specific user groups, the audio delay of TWS headsets is an important factor when users choose headsets, especially for game users. For TWS headsets, in order to improve the anti-interference ability, anti-lag ability in the use environment, and the synchronous playback effect of the left and right ear bodies, the headset bodies in the prior art will perform a certain degree of data volume caching and then perform corresponding decoding operations when the synchronous playback time of the left and right headsets is reached. Although the playback effect is ensured, the audio delay situation will relatively increase, affecting the user experience. Summary of the Invention

[0003] The purpose of the embodiments of the present disclosure is to provide a method for playing Bluetooth audio, a storage medium, and a true wireless headset, so as to solve the problem of audio delay in the prior art when true wireless headsets play audio.

[0004] The embodiments of the present disclosure adopt the following technical solutions: A method for playing Bluetooth audio, including: receiving data frames of Bluetooth audio, and detecting whether the number of the received data frames has reached a preset threshold; in the case that the number of the received data frames has reached the preset threshold, decoding the received data frames in sequence, and determining the playback time according to the decoding situation of the data frames; in the case that the playback time is reached, playing the decoded data frames in sequence.

[0005] In some embodiments, the decoding the received data frames in sequence includes: decoding the received first data frame by using a coprocessor, and storing the decoded first data frame in a first buffer.

[0006] In some embodiments, after decoding the received first data frame by using the coprocessor and storing the decoded first data frame in the first buffer, it further includes: decoding the second data frame by using the coprocessor, and storing the decoded second data frame in a second buffer, where the second data frame is the next data frame of the first data frame.

[0007] In some embodiments, when the playback time is reached, playing the decoded data frames in sequence includes: obtaining the decoded first data frame from the first buffer for playback.

[0008] In some embodiments, when the playback time is reached, playing the decoded data frames in sequence includes: using the coprocessor to decode a third data frame, where the third data frame is the next data frame of the second data frame.

[0009] In some embodiments, determining the playback time according to the decoding situation of the data frames includes: determining the playback time according to a first moment and a decoding duration; where the first moment is the moment when the number of data frames reaches the preset threshold, and the decoding duration is the time required for the coprocessor to complete the decoding of the first data frame and the second data frame.

[0010] In some embodiments, when the playback time is reached, playing the decoded data frames in sequence includes: converting the decoded data frames into analog signals for playback.

[0011] The embodiments of the present disclosure also provide a storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for playing Bluetooth audio are implemented.

[0012] The embodiments of the present disclosure also provide a true wireless headset, including at least a first earphone and a second earphone. Both the first earphone and the second earphone at least include a memory and a processor. A computer program is stored on the memory, and when the processor executes the computer program on the memory, the steps of the above-mentioned method for playing Bluetooth audio are implemented.

[0013] The beneficial effects of the embodiments of the present disclosure are as follows: During the process of playing Bluetooth audio, when a certain amount of data frames are received, relevant operations for decoding the received data frames in sequence are started, and the decoding of the data frames is completed during the waiting for the playback time to arrive, so that the decoded data frames can be directly played when the playback time arrives, thereby achieving the effect of reducing the overall delay and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0015] Figure 1 Flowchart of the Bluetooth audio playback method in the first embodiment of the present disclosure;

[0016] Figure 2 Schematic diagram of the timing of the audio playback process in the first embodiment of the present disclosure;

[0017] Figure 3 Schematic diagram of the structure of the first earphone or the second earphone in the truly wireless earphone in the third embodiment of the present disclosure. Detailed implementation manners

[0018] Reference is made herein to the accompanying drawings to describe the various solutions and features of the present disclosure.

[0019] It should be understood that various modifications can be made to the embodiments applied herein. Therefore, the above description should not be regarded as a limitation, but only as an example of the embodiments. Those skilled in the art will think of other modifications within the scope and spirit of the present disclosure.

[0020] The accompanying drawings included in the specification and forming a part of the specification illustrate the embodiments of the present disclosure, and together with the general description of the present disclosure given above and the detailed description of the embodiments given below are used to explain the principles of the present disclosure.

[0021] These and other features of the present disclosure will become apparent from the following description of the preferred forms of the embodiments given by way of non-limiting examples with reference to the accompanying drawings.

[0022] It should also be understood that although the present disclosure has been described with reference to some specific examples, those skilled in the art can surely implement many other equivalent forms of the present disclosure, which have the features as claimed and thus are all within the protection scope defined hereby.

[0023] When combined with the accompanying drawings, the above and other aspects, features and advantages of the present disclosure will become more apparent in view of the following detailed description.

[0024] Hereinafter, specific embodiments of the present disclosure are described with reference to the accompanying drawings; however, it should be understood that the embodiments applied are only examples of the present disclosure, and it can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid obscuring the present disclosure with unnecessary or redundant details. Therefore, the specific structural and functional details applied herein are not intended to be limiting, but only as a basis and representative basis for the claims to teach those skilled in the art to use the present disclosure in substantially any suitable detailed structure in a variety of ways.

[0025] This specification may use the phrases "in one embodiment", "in another embodiment", "in yet another embodiment", or "in other embodiments", which may each refer to one or more of the same or different embodiments according to the present disclosure.

[0026] For TWS earphones, in order to improve the anti-interference ability, anti-lagging ability of the earphone body in the usage environment, and the synchronous playback effect of the left and right ear bodies, the earphone bodies in the prior art will cache a certain amount of data and then set a playback time for realizing simultaneous playback of the left and right earphones, and perform corresponding decoding operations when this time is reached. Since the decoding operation on the received data frames is triggered only at this time, there will be a delay in audio playback during the process of waiting for the co-processor (CP) to perform decoding. Although the synchronous playback effect of the left and right earphones during playback is ensured, the overall audio delay situation will increase, affecting the user experience.

[0027] To solve the above problems, the first embodiment of the present disclosure provides a method for playing Bluetooth audio, which is mainly applied to an electronic device that receives and plays audio data through a Bluetooth protocol. Figure 1 The flowchart of the method for playing Bluetooth audio provided in this embodiment is shown, which mainly includes steps S10 to S30:

[0028] S10, receive the data frames of Bluetooth audio.

[0029] S20, detect whether the number of the data frames that have been received currently reaches a preset threshold. If the number of the data frames that have been received reaches the preset threshold, execute step S30; otherwise, continue to execute step S10 until the number of the data frames reaches the preset threshold.

[0030] The electronic device receives A2DP (Advanced Audio Distribution Profile) data frames from the air through the built-in Bluetooth function module. These data frames can be sent by terminals such as mobile phones and computers with Bluetooth function modules, and it is hoped to achieve audio playback through the transmission of Bluetooth data frames. Starting from the first received data frame, the electronic device performs cache statistics on a certain amount of data frames. When the number of received data frames exceeds the preset threshold, it proves that the Bluetooth communication is relatively stable and the process of data frame reception and transmission is normal. At this time, subsequent processing steps are carried out to ensure the transmission efficiency and quality; when the number of received data frames has not exceeded the preset threshold, data frames can continue to be received until after the preset threshold is reached and then subsequent steps are carried out. If the number of data frames received by the electronic device within a certain period of time has not exceeded the preset threshold, the user can be informed of the abnormal transmission process through methods such as pop-up prompts, voice prompts, or sound and light prompts, and the user is prompted to perform operations such as re-pairing the Bluetooth connection or adjusting the distance between devices to improve the Bluetooth transmission quality.

[0031] It should be noted that the specific value of the preset threshold mentioned in this embodiment can be set according to the actual situation. For example, it can be set by referring to the Bluetooth protocol version number used by the device, or other parameters can also be referred to for setting. This embodiment does not make specific limitations.

[0032] S30, decode the received data frames in sequence and determine the playback time according to the decoding situation of the data frames.

[0033] Different from the operation of decoding data frames only after the playback time arrives in the prior art, in this embodiment, when the number of currently received data frames reaches the preset threshold, the decoding operation of the data frames is started in sequence, so as to complete the decoding operation of a certain amount of data frames during the process of waiting for the playback time to arrive, so as to ensure that the decoded data frames can be directly played when the playback time arrives, thereby reducing the overall delay during the audio playback process. In addition, the setting of the playback time is used to trigger the playback time point of the electronic device, mainly for the synchronous playback of the left and right earphones in true wireless earphones. When the playback time arrives, a direct memory access (DMA) interrupt is triggered to implement operations such as decoding, transporting, and playing the decoded data frames.

[0034] When actually performing the decoding operation, first input the received first data frame into the coprocessor for decoding, and store the decoded first data frame in the first buffer after the coprocessor finishes decoding; where the first data frame refers to the first data frame received by the electronic device in chronological order; the coprocessor is mainly used to convert the A2DP data frame into a PCM (Pulse Code Modulation) data frame, that is, a digital signal; the first buffer (ping buffer) is a buffer set in the memory, which forms a double buffer (ping-pang buffer) with the second buffer (pang buffer). The data frames decoded by the coprocessor are alternately stored in the first buffer and the second buffer, and the decoded data frames can be alternately extracted from the first buffer and the second buffer to achieve playback. Through the design of the double buffer, when one of the two buffers is writing data, the other buffer has data being processed simultaneously, improving the efficiency of data processing in a parallel manner.

[0035] During the process of waiting for the playback time to arrive, when the first data frame is decoded and the decoded first data frame is stored in the first buffer, the second data frame can be input into the coprocessor for decoding. The second data frame is the next data frame of the first data frame. Immediately input the second data frame into the coprocessor after the first data frame is decoded, ensuring that the coprocessor can continuously decode the data frames and avoiding delays in processing time.

[0036] In some embodiments, the actual playback time is determined based on the first moment when the received data frame reaches a preset threshold, combined with the data frame decoding situation of the coprocessor. When actually determining, the duration required for the coprocessor to complete the decoding operations of the first data frame and the second data frame can be estimated first, and the corresponding duration is added to the first moment to obtain the second moment, and the second moment can be used as the playback time; it is also possible to use the decoding duration as the playback time after estimating the decoding duration. When executing, start timing and waiting from the first moment when the received data frame reaches the preset threshold until the waiting duration is the playback time and then start the subsequent playback operation.

[0037] It should be noted that when actually estimating the decoding duration, it can be estimated according to parameters such as the operation speed of the coprocessor, the processor model, and the data frame size, or it can be set according to the interruption interval of each DMA, or it can also be set with reference to the transmission difference between the left and right earphones, as long as the playback time covers the decoding time of two data frames, and there will be no situation where the decoded data to be played cannot be obtained from the first buffer and / or the second buffer when playback is required, thus generating an undesired playback delay.

[0038] S40. When the playback time is reached, the decoded data frames are played in sequence.

[0039] When the playback time is reached, the left and right earbuds of the true wireless earphones play the decoded data frames simultaneously, ensuring the synchronization of audio playback. During actual playback, that is, at the first DMA interrupt, the first data frame and the second data frame have been stored in the first buffer and the second buffer respectively. At this time, the decoded first data frame temporarily stored in the first buffer can be obtained and input into the digital-to-analog converter (DAC). After digital-to-analog conversion, it is converted from a digital signal to an analog signal and then output to the speaker for playback. At the same time, while obtaining the decoded first data frame from the first buffer, the third data frame is sent to the coprocessor. The third data frame is the next data frame of the second data frame. At the next DMA interrupt, the decoded second data frame stored in the second buffer is sent to the DAC for digital-to-analog conversion, and at the same time, the third data frame decoded by the coprocessor is stored in the first buffer, achieving the continuous playback effect of audio data.

[0040] During the actual decoding process, when the coprocessor finishes decoding the current data frame, the decoding operation of the next data frame can be performed when the next DMA interrupt arrives. For example, when the second DMA interrupt time is reached, the decoded third data frame is extracted from the coprocessor and stored in the first buffer. At this time, the fourth data frame can be input into the coprocessor for decoding to ensure the continuous decoding and playback processing of the audio data frames and achieve the audio playback effect. The fourth data frame is the next data frame of the third data frame.

[0041] It should be understood that in this embodiment, when the playback time is reached, the first buffer and the second buffer respectively store the decoded first data frame and the second data frame. At the first DMA interrupt, the decoded first data frame is transferred from the first buffer to the DAC for digital-to-analog conversion and played through the speaker; at the same time, the third data frame is sent to the coprocessor for preparation for decoding. At the second DMA interrupt, the decoded second data frame is transferred from the second buffer to the DAC for digital-to-analog conversion and played through the speaker. After the third data frame is decoded, it is stored in the already empty first buffer. The DMA simultaneously transports the subsequent fourth data frame to the coprocessor for decoding, and so on. Based on the dual-buffer design, continuous decoding of the coprocessor and continuous playback of the decoded data frames can be achieved.

[0042] Figure 2 Shows the timing schematic diagram of the audio playback process in this embodiment. As Figure 2As shown in the figure, in S21, the electronic device receives the first data frame at time T and starts to detect the number of data frames. After waiting for a duration of T0, when the number of data frames reaches the preset threshold, step S22 is executed. Step S22 is divided into three sub-steps. Among them, S22.1 is to set the playback time T1, S22.2 is to trigger the CP to perform the decoding operation, and S22.3 is used to implement the data frame transfer operation. During the process of waiting for T1 to arrive, S22.2 and S22.3 are executed in parallel to preprocess the data frames. After T1 arrives, S23 is executed, and the decoded PCM data is output to the speaker for playback after being converted by the DAC. Among them, the conversion delay of the DAC is T2.

[0043] Compared with the prior art solution, in this embodiment, by decoding the data frames in advance before the playback time, it is avoided that the data frames are decoded only when the playback time arrives, so that the decoded audio data available for playback cannot be obtained from the double buffer during playback, resulting in the problem that additional delay is required for playback. Furthermore, the overall delay is reduced, and the user experience is improved. In actual execution, by using the method provided in this embodiment, the parallel processing method can approximately save the duration of two DMA interrupts, about 46 milliseconds of delay. In the case where the transmission delay, digital-to-analog conversion delay, etc. cannot be reduced due to technical limitations, the overall delay of Bluetooth audio playback is reduced.

[0044] The second embodiment of the present disclosure provides a storage medium, which can be installed in any electronic device that transmits and plays audio via Bluetooth. Specifically, it is a computer-readable medium, storing a computer program. When the computer program is executed by a processor, it implements the method provided in any embodiment of the present disclosure, including the following steps S31 to S33:

[0045] S31, receiving the data frames of Bluetooth audio and detecting whether the number of currently received data frames reaches the preset threshold;

[0046] S32, when the number of currently received data frames reaches the preset threshold, decoding the received data frames in sequence and determining the playback time according to the decoding situation of the data frames;

[0047] S33, when the playback time is reached, playing the decoded data frames in sequence.

[0048] When the computer program is executed by the processor to decode the received data frames in sequence, specifically, the following steps are executed by the processor: using the coprocessor to decode the first received data frame and storing the decoded first data frame in the first buffer.

[0049] After the computer program is executed by the processor to decode the received first data frame by using a coprocessor and store the decoded first data frame in the first buffer, the processor further executes the following steps: decoding the second data frame by using the coprocessor, where the second data frame is the next data frame of the first data frame, and storing the decoded second data frame in the second buffer.

[0050] When the computer program is executed by the processor to play the decoded data frames in sequence when the playback time is reached, the processor specifically executes the following steps: obtaining the decoded first data frame from the first buffer for playback.

[0051] When the computer program is executed by the processor to play the decoded data frames in sequence when the playback time is reached, the processor specifically executes the following steps: decoding the third data frame by using the coprocessor, where the third data frame is the next data frame of the second data frame.

[0052] When the computer program is executed by the processor to determine the playback time according to the decoding situation of the data frames, the processor specifically executes the following steps: determining the playback time according to the first moment and the decoding duration; where the first moment is the moment when the number of data frames reaches a preset threshold, and the decoding duration is the time required for the coprocessor to complete the decoding of the first data frame and the second data frame.

[0053] When the computer program is executed by the processor to play the decoded data frames in sequence when the playback time is reached, the processor specifically executes the following steps: converting the decoded data frame into an analog signal for playback.

[0054] In the process of Bluetooth audio playback in this embodiment, when a certain amount of data frames are received, the relevant operations of decoding the received data frames in sequence are started, and the decoding of the data frames is completed during the waiting for the playback time to arrive, so as to directly play the decoded data frames when the playback time arrives, thereby achieving the effect of reducing the overall delay and improving the user experience.

[0055] The third embodiment of the present disclosure provides a true wireless headset, which at least includes a first earphone and a second earphone. Both the first earphone and the second earphone communicate with the terminal through a Bluetooth protocol and receive Bluetooth audio data. Their structural schematic diagrams are all as Figure 3 shown, and at least include a memory 100 and a processor 200. A computer program is stored on the memory 100, and when the processor 200 executes the computer program on the memory 100, the method provided by any embodiment of the present disclosure is implemented. Exemplarily, the computer program steps implemented by the processor are as follows S41 to S43:

[0056] S41, receive the data frames of Bluetooth audio and detect whether the number of data frames received currently has reached a preset threshold;

[0057] S42, when the number of data frames received currently has reached the preset threshold, decode the received data frames in sequence and determine the playing time according to the decoding situation of the data frames;

[0058] S43, when the playing time is reached, play the decoded data frames in sequence.

[0059] When the processor executes the computer program stored in the memory to decode the received data frames in sequence, it specifically executes the following computer program: decode the received first data frame by using a coprocessor and store the decoded first data frame in the first buffer.

[0060] After the processor executes the computer program stored in the memory to decode the received first data frame by using a coprocessor and store the decoded first data frame in the first buffer, it also executes the following computer program: decode the second data frame by using the coprocessor and store the decoded second data frame in the second buffer, where the second data frame is the next data frame of the first data frame.

[0061] When the processor executes the computer program stored in the memory to play the decoded data frames in sequence when the playing time is reached, it specifically executes the following computer program: obtain the decoded first data frame from the first buffer for playing.

[0062] When the processor executes the computer program stored in the memory to play the decoded data frames in sequence when the playing time is reached, it specifically executes the following computer program: decode the third data frame by using the coprocessor, where the third data frame is the next data frame of the second data frame.

[0063] When the processor executes the computer program stored in the memory to determine the playing time according to the decoding situation of the data frames, it specifically executes the following computer program: play the time according to the first moment and the decoding duration; where the first moment is the moment when the number of data frames reaches the preset threshold, and the decoding duration is the time required for the coprocessor to complete the decoding of the first data frame and the second data frame.

[0064] When the processor executes the computer program stored in the memory to play the decoded data frames in sequence when the playing time is reached, it specifically executes the following computer program: convert the decoded data frames into analog signals and then play them.

[0065] In the process of Bluetooth audio playback in this embodiment, when a certain amount of data frames are received, the related operations of decoding the received data frames in sequence are started, and the decoding of the data frames is completed during the waiting for the playback time to arrive, so as to directly play the decoded data frames when the playback time arrives, thereby achieving the effect of reducing the overall delay and improving the user experience.

[0066] The above has described multiple embodiments of the present disclosure in detail, but the present disclosure is not limited to these specific embodiments. Based on the concept of the present disclosure, those skilled in the art can make various variations and modifications to the embodiments, and these variations and modifications should fall within the scope of protection required by the present disclosure.

Claims

1. A method for playing Bluetooth audio, characterized in that, Including: Receiving data frames of Bluetooth audio and detecting whether the number of the received data frames has reached a preset threshold; When the number of the received data frames reaches the preset threshold, using a coprocessor to decode the received first data frame, storing the decoded first data frame in a first buffer area, using the coprocessor to decode a second data frame, storing the decoded second data frame in a second buffer area, the second data frame being the next data frame of the first data frame, and determining a playing time according to the decoding situation of the data frames, the playing time covering the decoding time of two data frames; When the playing time is reached, playing the decoded data frames in sequence, including, at a first DMA interrupt, obtaining the decoded first data frame from the first buffer area for playing, using the coprocessor to decode a third data frame, the third data frame being the next data frame of the second data frame, and at the next DMA interrupt, playing the decoded second data frame stored in the second buffer area, and at the same time storing the third data frame decoded by the coprocessor in the first buffer area.

2. The playback method according to claim 1, wherein The determining the playing time according to the decoding situation of the data frames includes: Determining the playing time according to a first moment and a decoding duration; Wherein, the first moment is the moment when the number of the data frames reaches the preset threshold, and the decoding duration is the time required for the coprocessor to complete the decoding of the first data frame and the second data frame.

3. The playback method according to claim 1 or 2, characterized in that, The playing the decoded data frames in sequence when the playing time is reached includes: Converting the decoded data frames into analog signals and then playing them.

4. A storage medium stores a computer program, characterized in that, When the computer program is executed by a processor, the steps of the method for playing Bluetooth audio according to any one of claims 1 to 3 are implemented.

5. A true wireless earphone, at least comprising a first earphone and a second earphone, wherein both the first earphone and the second earphone at least comprise a memory and a processor, and a computer program is stored on the memory, characterized in that, When the processor executes the computer program on the memory, the steps of the method for playing Bluetooth audio according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Streaming media data playing method and device

    CN110855645A

  • Wireless sound box playing control method, device and system based on wireless audio transmission

    CN114173426A