Audio playing method, system, electronic device and storage medium
Patent Information
- Application Number
- CN202310283768.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-22
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-03-22
AI Technical Summary
[0003]而在某些应用场景下,往往需要让不同的蓝牙设备一起播放音频,例如让不同的蓝牙耳机共享同一个手机传输的音乐等应用场景,现有技术中从设备在播放音频数据时,一般使用软件读取主设备发送的数据时间戳来进行同步,具有实时性差的缺点,多个从设备间易出现播放延迟,播放延迟会进一步导致各音频播放速度的差异,造成音频听感变差
[0006]在本申请实施例中,各第二蓝牙设备与第一蓝牙设备进行通信依次产生第一同步信号、第二同步信号,从而使各第二蓝牙设备均能以第一蓝牙设备为参考,统一时间标准,接收的音频数据在播放时能够以统一时间标准同步,实现音频的同步播放,解决了由于不同电子设备的系统时间不同,导致音频数据不同步的问题。
Smart Images

Figure CN116321093B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data synchronization technology, and in particular to an audio playback method, system, electronic device and storage medium. Background Technology
[0002] Bluetooth is a wireless communication protocol technology that enables the exchange of audio data between multiple Bluetooth-enabled electronic devices. Many Bluetooth devices on the market, such as Bluetooth headsets and Bluetooth speakers, have audio playback capabilities.
[0003] In certain application scenarios, it is often necessary for different Bluetooth devices to play audio together, such as allowing different Bluetooth headphones to share music transmitted from the same mobile phone. In existing technologies, when the slave device plays audio data, it generally uses software to read the data timestamp sent by the master device for synchronization, which has the disadvantage of poor real-time performance. Playback delays are prone to occur between multiple slave devices, and these delays will further lead to differences in the playback speed of each audio file, resulting in a deterioration in the audio listening experience. Summary of the Invention
[0004] The purpose of this application is to solve the technical problems mentioned in the background section and to provide an audio playback method, system, electronic device and storage medium.
[0005] In a first aspect, embodiments of this application provide an audio playback method applied to a second Bluetooth device, comprising: communicating with a first Bluetooth device to generate a first synchronization signal; generating a second synchronization signal that has a time delay from the first synchronization signal based on the first synchronization signal; and playing audio based on the second synchronization signal to achieve audio synchronization.
[0006] In this embodiment, each second Bluetooth device communicates with the first Bluetooth device to generate a first synchronization signal and a second synchronization signal in sequence, so that each second Bluetooth device can use the first Bluetooth device as a reference to unify the time standard. The received audio data can be synchronized with the unified time standard during playback, realizing synchronized audio playback and solving the problem of audio data asynchrony caused by different system times of different electronic devices.
[0007] In one embodiment, communicating with the first Bluetooth device to generate a first synchronization signal includes: receiving an audio data packet sent by the first Bluetooth device and generating a radio frequency (RF) receiving signal; and using the RF receiving signal as the first synchronization signal.
[0008] In this embodiment, the radio frequency received signal serves as the first synchronization signal to synchronize the internal Bluetooth clock. The second Bluetooth device can calculate the deviation between its internal Bluetooth clock and the Bluetooth clock of the first Bluetooth device based on the first synchronization signal and perform calibration. The first synchronization signal has a precision at the microsecond level, which greatly improves real-time performance and synchronization compared to the existing technology where the second Bluetooth device needs to read the timestamp sent by the first Bluetooth device through software.
[0009] In one embodiment, the step of playing audio according to the second synchronization signal to achieve audio synchronization includes: performing asynchronous rate conversion on the audio data packets through the second synchronization signal to achieve synchronized audio playback.
[0010] In this embodiment, the audio clock in the second Bluetooth device is synchronized according to the second synchronization signal. The audio clock calibrates the audio data during audio playback. By synchronizing the audio clock in the second Bluetooth device, multiple second Bluetooth devices can achieve synchronized audio playback.
[0011] Secondly, this application provides an audio playback method applied to a first Bluetooth device, which communicates with each second Bluetooth device by sending audio data packets to different second Bluetooth devices to achieve audio synchronization between the second Bluetooth devices.
[0012] In this embodiment, the first Bluetooth device communicates with each of the second Bluetooth devices, so that each of the second Bluetooth devices can determine the clock deviation using the first synchronization signal and process the audio data using the second synchronization signal as a standard, thereby improving the synchronization of the sound effects played by the multiple second Bluetooth devices.
[0013] In one embodiment, the first Bluetooth device communicates with a first audio device and a second audio device respectively; wherein, the first audio device is one of a plurality of second Bluetooth devices, and the second audio device is another of the plurality of second Bluetooth devices that is different from the first audio device.
[0014] In one embodiment, before the first Bluetooth device communicates with the first audio device and the second audio device respectively, the method further includes: determining the transmission period of audio data packets.
[0015] Thirdly, embodiments of this application also provide an audio playback system, including: a first Bluetooth device and a plurality of second Bluetooth devices, wherein the first Bluetooth device and the second Bluetooth devices are connected via a Bluetooth link, the first Bluetooth device is configured to send audio data packets to different second Bluetooth devices; the second Bluetooth devices are configured to receive audio data packets sent by the first Bluetooth device to generate a first synchronization signal, generate a second synchronization signal that has a time delay from the first synchronization signal according to the first synchronization signal, and perform audio playback according to the second synchronization signal to achieve audio synchronization.
[0016] In one embodiment, the second Bluetooth device is configured to receive audio data packets sent by the first Bluetooth device and generate a radio frequency receiving signal; wherein the radio frequency receiving signal is a first synchronization signal.
[0017] Fourthly, embodiments of this application also provide an electronic device, the electronic device comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the above-described audio playback method.
[0018] Fifthly, embodiments of this application also provide a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the above-described audio playback method. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly described below.
[0020] Figure 1 This is a schematic diagram of an audio playback system provided in one embodiment of this application;
[0021] Figure 2 This is one of the flowcharts illustrating an audio playback method according to an embodiment of this application;
[0022] Figure 3 This is a schematic diagram of a synchronization signal waveform provided in an embodiment of this application;
[0023] Figure 4 This is a second schematic flowchart illustrating an audio playback method according to an embodiment of this application.
[0024] Figure 5 One of the schematic diagrams illustrating communication between Bluetooth devices according to an embodiment of this application;
[0025] Figure 6 A second schematic diagram illustrating communication between Bluetooth devices according to an embodiment of this application;
[0026] Figure 7 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0027] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0028] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of this application, but not all embodiments.
[0029] Please refer to Figure 1 This is a schematic diagram of an audio playback system provided in an embodiment of this application.
[0030] The audio playback system includes a first Bluetooth device 100 and multiple second Bluetooth devices 200, which are connected via a Bluetooth link. The first Bluetooth device 100 is configured to send audio data packets to the second Bluetooth devices 200. The second Bluetooth devices 200 are configured to receive the audio data packets sent by the first Bluetooth device 100 to generate a first synchronization signal, and to generate a second synchronization signal with a time delay based on the first synchronization signal. The second Bluetooth devices 200 synchronize their internal audio clocks based on the second synchronization signal to achieve audio synchronization among the multiple second Bluetooth devices 200.
[0031] In one embodiment, the first Bluetooth device 100 and the plurality of second Bluetooth devices 200 are all equipped with Bluetooth chips that support the Low Energy Audio (LE Audio) protocol, and data transmission between the first Bluetooth device 100 and the second Bluetooth devices 200 is performed via a link using the LE Audio protocol. Of course, in practical applications, the first Bluetooth device 100 and the plurality of second Bluetooth devices 200 may also perform data transmission via other protocols, all of which fall within the scope of protection of this application.
[0032] In one embodiment, the first Bluetooth device 100 is a control device, including but not limited to smartphones, smartwatches, etc. The second Bluetooth device 200 is a terminal device, including but not limited to Bluetooth headsets, Bluetooth speakers, etc.
[0033] It should be noted that the first Bluetooth device 100 and the second Bluetooth device 200 can also be other types of Bluetooth devices. The above is just an example and is not intended to limit this application in any way.
[0034] The number of second Bluetooth devices 200 in the audio system provided in this embodiment is multiple, including but not limited to two, three, four, or five second Bluetooth devices 200.
[0035] In this embodiment, a first Bluetooth device 100 sends audio data packets to different second Bluetooth devices 200. The second Bluetooth device 200 receives the audio data packets sent by the first Bluetooth device 100 and generates a first synchronization signal, and generates a second synchronization signal that has a time delay with the first synchronization signal. Based on the second synchronization signal, the clock deviation of the audio data packets relative to the first Bluetooth device is calculated, thereby achieving audio synchronization.
[0036] In one embodiment, the first Bluetooth device 100 communicates with a first audio device and a second audio device, wherein the first audio device is one of a plurality of second Bluetooth devices 200, and the second audio device is another of the plurality of second Bluetooth devices that is different from the first audio device.
[0037] In this system, the first Bluetooth device 100 serves as the master device, and the first audio device and the second audio device serve as two slave devices. The audio playback system is a Bluetooth communication system based on a connection with one master and two slave devices.
[0038] The first Bluetooth device 100 sends audio data packets to the first audio device and the second audio device. The first audio device and the second audio device receive the audio data packets, calculate the deviation between their internal Bluetooth clocks and the Bluetooth clock of the first Bluetooth device 100, and then perform calibration. Finally, the audio devices play audio according to their calibrated internal audio clocks to achieve audio synchronization between the first audio device and the second audio device.
[0039] Based on the same inventive concept described above, this application also provides an audio playback method applied to a second Bluetooth device.
[0040] Please refer to Figure 2 This is a flowchart illustrating an audio playback method provided in an embodiment of this application. The audio playback method includes steps S110 to S130.
[0041] Step S110: Communicate with the first Bluetooth device to generate a first synchronization signal.
[0042] In this configuration, the first Bluetooth device acts as the master device, the second Bluetooth device acts as the slave device, the first Bluetooth device communicates with multiple second Bluetooth devices via Bluetooth links, and the second Bluetooth devices communicate with the first Bluetooth device and generate a first synchronization signal.
[0043] Figure 3 This is a waveform diagram of the synchronization signal generated by the second Bluetooth device in one embodiment of this application.
[0044] Please refer to Figure 3 From bottom to top, these correspond to the timing relationships of the first synchronization signal, the second synchronization signal, and the audio data packet, respectively.
[0045] In this step, after the second Bluetooth device, acting as a slave device, receives the audio data packet sent by the first Bluetooth device, it generates an RF receiving signal almost simultaneously. This RF receiving signal serves as the first synchronization signal to synchronize the internal Bluetooth clock.
[0046] The second Bluetooth device calculates the deviation between its internal Bluetooth clock and the Bluetooth clock of the first Bluetooth device based on the first synchronization signal, and then performs calibration. The specific method for calculating and calibrating the clock deviation is existing technology and will not be described in detail here.
[0047] In this embodiment, the radio frequency received signal is generated within a few microseconds after the data audio data packet is received. The resulting first synchronization signal also has microsecond-level precision. Compared with the existing technology where the second Bluetooth device needs to read the timestamp sent by the first Bluetooth device through software, the real-time performance of communication between the master and slave devices is greatly improved.
[0048] Step S120: Based on the first synchronization signal, generate a second synchronization signal that has a time delay from the first synchronization signal. The second synchronization signal generated in this step is used for synchronizing the audio clock in the second Bluetooth device.
[0049] Please refer to Figure 3 Within one transmission cycle, there is a time delay of duration t between the second synchronization signal and the first synchronization signal.
[0050] Since the second Bluetooth device needs time to process the audio data after receiving the audio data packet, it cannot immediately perform audio data parsing. Therefore, in this embodiment, an audio playback method generates a second synchronization signal after a time delay of duration t after generating the first synchronization signal. This allows the second Bluetooth device sufficient time to process the received audio data packet. Accordingly, the specific duration t of the time delay can be set according to different audio processing requirements to generate the second synchronization signal at an appropriate time.
[0051] In some embodiments, different second Bluetooth devices have different and / or non-fixed time delays t, and the second Bluetooth devices generate corresponding second synchronization signals by flexibly adjusting the time delay t.
[0052] Step S130: Play audio according to the second synchronization signal to achieve audio synchronization.
[0053] In this step, the second Bluetooth device synchronizes its internal audio clock according to the second synchronization signal. The audio clock is used to calibrate the audio data during audio playback. Therefore, by synchronizing the audio clock in the second Bluetooth device, the latency of the second Bluetooth device playing audio is reduced. It is generally believed that the smaller the latency, the better the synchronization effect.
[0054] Correspondingly, each second Bluetooth device calculates the clock deviation of its audio clock relative to the first Bluetooth device based on the second synchronization signal and then performs calibration to asynchronously convert the audio data packets.
[0055] Once the audio clocks of multiple second Bluetooth devices are synchronized, the second Bluetooth devices play audio according to the calibrated internal audio clock, which can realize the synchronization of audio playback between the second Bluetooth devices. This solves the problem of poor listening experience caused by the difference in audio playback speed between multiple slave devices in the prior art, and improves the listening effect.
[0056] Based on the same inventive concept described above, this application also provides an audio playback method applied to a first Bluetooth device.
[0057] Please refer to Figure 4 This is a flowchart illustrating an audio playback method provided in an embodiment of this application. The audio playback method is applied to a first Bluetooth device and specifically includes step S210.
[0058] Step S210: Applied to the first Bluetooth device, it communicates with each of the second Bluetooth devices by sending audio data packets to different second Bluetooth devices to achieve audio synchronization between the second Bluetooth devices.
[0059] In this embodiment, the first Bluetooth device sends audio data packets to each of the second Bluetooth devices at fixed time intervals. Each of the second Bluetooth devices receives the audio data packets to generate a first synchronization signal. Thus, each of the second Bluetooth devices can determine its internal Bluetooth clock deviation using the first synchronization signal as a reference, and then uniformly calibrate its internal audio clock according to the second synchronization signal. This allows the audio data received by multiple second Bluetooth devices to be synchronized during playback, thereby solving the problem of deteriorated listening experience caused by differences in audio playback speed between multiple slave devices in the prior art, and improving the listening effect.
[0060] In one embodiment, the first Bluetooth device controls only two second Bluetooth devices to play audio synchronously. That is, the first Bluetooth device communicates with the first audio device and the second audio device respectively. The first audio device is one of a plurality of second Bluetooth devices, and the second audio device is another of a plurality of second Bluetooth devices that is different from the first audio device.
[0061] Figure 5This is a schematic diagram illustrating communication between a first Bluetooth device and a first audio device and a second audio device in one embodiment of this application.
[0062] Please refer to Figure 5 C represents the master device, which is the first Bluetooth device, and P1 and P2 represent the two slave devices, which are the first audio device and the second audio device, respectively.
[0063] The first Bluetooth device C sends audio data packets to the first audio device P1 and the second audio device P2 at fixed time intervals within a transmit / receive cycle. The first audio device P1 and the second audio device P2 receive the audio data packets at the corresponding time, calculate the deviation between their internal Bluetooth clocks and the Bluetooth clock of the first Bluetooth device C, and then perform asynchronous rate conversion on the audio data to finally achieve audio synchronization between the two audio devices.
[0064] In this embodiment, the first Bluetooth device communicates with the first audio device and the second audio device respectively. The first audio device and the second audio device can both use the first Bluetooth device as a reference to a unified time standard. The audio data received by the first audio device and the second audio device can be synchronized with a unified time standard during playback, which solves the problem of audio data asynchrony caused by the different system times of different electronic devices.
[0065] Please refer to Figure 6 This is a second schematic diagram of communication between Bluetooth devices provided in an embodiment of this application. The first Bluetooth device can also send audio data packets to each of the second Bluetooth devices through a broadcast link. TX is the audio data packet sent by the first Bluetooth device. Correspondingly, the broadcast link is a unidirectional transmission link. All the second Bluetooth devices can simultaneously receive the audio data packets sent by the first Bluetooth device and generate the first and second synchronization signals in sequence according to the audio data packets to achieve synchronized audio playback.
[0066] In one embodiment, before the first Bluetooth device communicates with each of the second Bluetooth devices, the method further includes: determining the transmission and reception period of audio data packets.
[0067] The first Bluetooth device communicates with the first and second audio devices based on the LE Audio ISO protocol. According to the LE Audio ISO protocol, the Bluetooth devices communicate within a data transmission / reception cycle of ISO_interval (see reference). Figure 3 At the beginning, data transmission and reception are performed. After one data transmission and reception cycle ISO_interval ends, it is necessary to wait for the next data transmission and reception cycle ISO_interval before continuing to transmit and receive data. This data transmission and reception cycle ISO_interval can be set to N*1.25ms, where N can be any integer excluding zero.
[0068] In other embodiments, based on the Bluetooth protocol described above, other wireless communication protocols, such as the 5.8 GHz band, can be used for synchronized audio playback, which also falls within the scope of protection of this application.
[0069] Based on the same inventive concept described above, this application also provides an electronic device 3, which may be either the first Bluetooth device or the second Bluetooth device described above.
[0070] Please refer to Figure 7 The electronic device 3 includes: at least one processor 31, a memory 32, and a Bluetooth chip 33. Figure 7 Taking a processor 31 as an example. The processor 31, memory 32, and Bluetooth chip 33 are connected via bus 30. The memory 32 stores instructions that can be executed by the processor 31. The instructions are executed by the processor 31 so that the electronic device 3 can perform all or part of the audio playback method in the above embodiment.
[0071] The memory 32 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0072] It should be noted that the above-mentioned electronic device 3 is merely an example and should not impose any limitations on the function and scope of use of the embodiments of this application.
[0073] In addition, those skilled in the art will understand that electronic device 3 may include more or fewer components than shown in the figure, or combine certain components. For example, electronic device 3 may also include components such as a speaker, radio frequency circuit, input unit, sensor, audio circuit, and power supply, which will not be described in detail here.
[0074] This application also provides a computer-readable storage medium storing a computer program that can be executed by a processor 31 to perform the audio playback method provided in this application.
[0075] The methods disclosed in the several embodiments provided in this application can also be implemented in other ways. The embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of 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, which contains one or more executable instructions for implementing a specified logical function. In some 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 diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, 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.
[0076] In addition, the functional modules 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.
[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. An audio playback method, characterized in that, Applied to a second Bluetooth device, the method includes: The first Bluetooth device communicates with the first Bluetooth device to generate a first synchronization signal; the second Bluetooth device calculates the deviation between its internal Bluetooth clock and the Bluetooth clock of the first Bluetooth device based on the first synchronization signal and performs calibration accordingly. Based on the first synchronization signal, a second synchronization signal with a time delay from the first synchronization signal is generated; Audio is played according to the second synchronization signal to achieve audio synchronization between the second Bluetooth devices; The step of communicating with the first Bluetooth device to generate the first synchronization signal includes: The system receives audio data packets sent by the first Bluetooth device and generates a radio frequency (RF) receiving signal; wherein the RF receiving signal is a first synchronization signal. Audio playback based on the second synchronization signal includes: asynchronously converting the audio data packets using the second synchronization signal to achieve synchronized audio playback.
2. An audio playback method, characterized in that, Applied to a first Bluetooth device, the method includes: The second Bluetooth device communicates with each other by sending audio data packets to different second Bluetooth devices to achieve audio synchronization between the second Bluetooth devices; the second Bluetooth device performs the audio playback method of claim 1.
3. The audio playback method according to claim 2, characterized in that, The first Bluetooth device communicates with the first audio device and the second audio device respectively; wherein, the first audio device is one of a plurality of second Bluetooth devices, and the second audio device is another of a plurality of second Bluetooth devices that is different from the first audio device.
4. The audio playback method according to claim 3, characterized in that, Before the first Bluetooth device communicates with the first audio device and the second audio device respectively, the method further includes: determining the transmission period of audio data packets.
5. An audio playback system, characterized in that, include: A first Bluetooth device and multiple second Bluetooth devices are connected via a Bluetooth link. The first Bluetooth device is configured to send audio data packets to different second Bluetooth devices. The second Bluetooth devices are configured to receive audio data packets sent by the first Bluetooth device to generate a first synchronization signal, calculate the deviation between their internal Bluetooth clock and the Bluetooth clock of the first Bluetooth device based on the first synchronization signal, and perform calibration. They also generate a second synchronization signal that has a time delay from the first synchronization signal, and play audio based on the second synchronization signal to achieve audio synchronization. The second Bluetooth device is configured to receive audio data packets sent by the first Bluetooth device and generate a radio frequency receiving signal; wherein the radio frequency receiving signal is a first synchronization signal.
6. An electronic device, characterized in that, The electronic device includes: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the audio playback method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the audio playback method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Data synchronization method and apparatus, device, system, and storage medium
CN112771941A