A method, apparatus, system and storage medium for audio playback

By allocating Bluetooth audio channel identification in smart devices and determining audio channel strategies, the sound loss problem in Bluetooth audio playback is solved, and selective single-channel or dual-channel playback is achieved, which expands the application range and ensures data integrity and improves playback effect.

CN114697930BActive Publication Date: 2025-08-05SHENZHEN TCL NEW-TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011625824.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-30
Publication Date
2025-08-05
Estimated Expiration
2040-12-30

AI Technical Summary

Technical Problem

The existing dual-channel audio playback is lost when copying the audio data in the Bluetooth protocol stack and playing it simultaneously, resulting in failed playback and poor playback effect.

Method used

The intelligent device allocates Bluetooth audio channel identification when the Bluetooth connection is successful, determines the audio channel policy, and controls the Bluetooth device to play audio data according to the policy, adopts a single or dual audio channel strategy, and uses frequency division multiplexing technology to merge audio data to reduce sound loss.

Benefits of technology

It realizes that users selectively play single or dual-channel according to their needs, expand the application group, reduce sound loss, ensure data integrity, and improve playback effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114697930B_ABST
    Figure CN114697930B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, system and storage medium for audio playback. The method includes: when the Bluetooth connection with a Bluetooth device is successfully established, allocating a Bluetooth audio channel identifier to determine an audio channel policy, where the audio channel policy includes single-channel and dual-channel audio channel policies; obtaining audio data, and controlling the corresponding Bluetooth device to play the audio corresponding to the audio data according to the determined audio channel policy. By enabling the intelligent device to be compatible with single-channel and dual-channel audio channels, the user can selectively play audio in single-channel or dual-channel mode according to requirements, expanding the application group. Moreover, by starting the dual-channel audio channel to synchronously transmit the same audio data, the phenomenon of audio loss can be reduced, ensuring the integrity of the data, achieving the purpose of dual-channel Bluetooth audio playback. And by judging the assistive sound attribute to determine whether it is necessary to perform assistive sound processing on the audio source data in different caches to meet the needs of people with assistive sound requirements, expanding the application group and facilitating promotion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Bluetooth technology, and in particular to a method, device, system and storage medium for audio playback. Background Art

[0002] With the popularization of Bluetooth functions in smart TVs, the relationship between smart TVs and Bluetooth speakers has become increasingly close. In the existing dual-channel audio playback, the audio data to be played is copied in the Bluetooth protocol stack and then the dual-channel playback devices play synchronously. There is a phenomenon of lost audio before the audio data is copied, resulting in lost audio in the copied data, causing the dual-channel playback devices to play failed, with poor playback effect and reduced playback quality.

[0003] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention

[0004] Based on this, in view of the above problems, there is a need to propose a method, device, system and storage medium for audio playback to solve the technical problem of poor playback effect in the existing technology.

[0005] In a first aspect, the present application provides a method for audio playback, which is applied to a smart device. The method for audio playback includes:

[0006] When the smart device is successfully Bluetooth-connected to a Bluetooth device, allocate a Bluetooth audio channel identifier to the Bluetooth device;

[0007] Determine an audio channel policy according to the allocated Bluetooth audio channel identifier;

[0008] Obtain audio data, and control the corresponding Bluetooth device to play the audio corresponding to the audio data according to the determined audio channel policy.

[0009] Optionally, before the smart device is successfully Bluetooth-connected to the Bluetooth device, it includes:

[0010] Receive Bluetooth connection signals of at least one Bluetooth device;

[0011] If the advanced audio distribution thread corresponding to the Bluetooth connection signal has been started, determine that the smart device is successfully Bluetooth-connected to the Bluetooth device corresponding to the Bluetooth connection signal;

[0012] If the advanced audio distribution thread corresponding to the Bluetooth connection signal has not been started, determine that the smart device is Bluetooth-connected to the Bluetooth device corresponding to the Bluetooth connection signal fails.

[0013] Optionally, after receiving the Bluetooth connection signals of at least one Bluetooth device, it further includes:

[0014] Determine whether there is a network-configured Bluetooth device that has been successfully connected via Bluetooth on the smart device;

[0015] If there is at most one network-configured Bluetooth device that has been successfully connected via Bluetooth on the smart device, determine whether the Advanced Audio Distribution Profile (A2DP) thread corresponding to the Bluetooth connection signal has been started;

[0016] If there are two network-configured Bluetooth devices on the smart device, the smart device discards the Bluetooth connection signal and does not perform a Bluetooth connection.

[0017] Optionally, the audio channel strategy includes a single-channel audio channel strategy and a dual-channel audio channel strategy. The determination of the audio channel strategy based on the allocated Bluetooth audio channel identifier specifically includes:

[0018] If only the allocated Bluetooth audio channel identifier is equal to 0, establish a single-channel audio channel and use the single-channel audio channel strategy as the audio channel strategy;

[0019] If there is an allocated Bluetooth audio channel identifier equal to 1, establish a dual-channel audio channel and use the dual-channel audio channel strategy as the audio channel strategy, where the dual-channel audio channel consists of two single-channel audio channels.

[0020] Optionally, if the determined audio channel strategy is the single-channel audio channel strategy, the control of the corresponding Bluetooth device to play the audio corresponding to the audio data according to the determined audio channel strategy specifically includes:

[0021] Obtain the first audio data of the single-channel audio channel;

[0022] Convert the first audio data into a first file in a standard format compliant with the Bluetooth audio transmission protocol;

[0023] Decode the first file into a first audio signal and transmit it to the Bluetooth device to play the first audio signal.

[0024] Optionally, if the determined audio channel strategy is the dual-channel audio channel strategy, the control of the corresponding Bluetooth device to play the audio corresponding to the audio data according to the determined audio channel strategy specifically includes:

[0025] Obtain the second audio data corresponding to two single-channel audio channels;

[0026] Merge the two second audio data into composite audio data using frequency division multiplexing technology;

[0027] Convert the composite audio data into a second file in a standard format compliant with the Bluetooth audio transmission protocol;

[0028] Decode the second file into a second audio signal and transmit it to each Bluetooth device to play the second audio signal.

[0029] Optionally, the dual-channel audio channel includes a first channel link and a second channel link, and the determined audio channel policy is a dual-channel audio channel policy. The method further includes:

[0030] Respectively determine whether the remaining memory of the first buffer of the first channel link is less than a preset threshold and whether the remaining memory of the second buffer of the second path link is less than a preset threshold;

[0031] If there is a situation where the remaining memory of the first buffer is less than the preset threshold, suspend the transmission of the second audio data of the second channel link;

[0032] If there is a situation where the remaining memory of the second buffer is less than the preset threshold, suspend the transmission of the second audio data of the first path link

[0033] In a second aspect, the present application provides an audio playback device, and the device includes:

[0034] An allocation unit, configured to allocate a Bluetooth audio channel identifier to the Bluetooth device when the Bluetooth connection with the Bluetooth device is successful;

[0035] A determination unit, configured to determine an audio channel policy according to the allocated Bluetooth audio channel identifier;

[0036] A control unit, configured to obtain audio data and control the corresponding Bluetooth device to play the audio corresponding to the audio data according to the determined audio channel policy.

[0037] In a third aspect, an embodiment of the present application further provides an audio playback system, and the system includes a smart device and at least one Bluetooth device. The smart device is Bluetooth-connected to the Bluetooth device. Among them, the smart device at least includes the above-mentioned audio playback device.

[0038] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, storing a computer program, and when the computer program is executed by a processor, the processor is caused to execute the steps in the above-mentioned audio playback method.

[0039] Adopting the embodiments of the present invention has the following beneficial effects:

[0040] The technical solution provided by the embodiments of the present invention enables the smart device to be compatible with single-channel audio channels and dual-channel audio channels, so that users can selectively play in a single channel or a dual channel according to their needs, expanding the application group and facilitating promotion. Moreover, by starting the dual-channel audio channel to synchronously transmit the same audio data, the phenomenon of lost audio can be reduced, the integrity of the data can be ensured, and the purpose of dual-channel Bluetooth audio playback can be achieved. Brief Description of the Drawings

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

[0042] Among them:

[0043] Figure 1 is a schematic flowchart of the method for audio playback in an embodiment of the present application;

[0044] Figure 2 is a schematic structural diagram of the system for audio playback in an embodiment of the present application;

[0045] Figure 3 is a schematic structural diagram of the device for audio playback in an embodiment of the present application;

[0046] Figure 4 is a block diagram of the structure of the smart device in an embodiment of the present application. Detailed Description of the Embodiments

[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0048] Please refer to Figure 1 , which is a schematic flowchart of the method for audio playback in an embodiment of the present application. The method includes:

[0049] Step 101: When the smart device successfully establishes a Bluetooth connection with the Bluetooth device, allocate a Bluetooth audio channel identifier to the Bluetooth device;

[0050] In an embodiment of the present application, the method for audio playback is applied to a system for audio playback. As Figure 2 described, the system includes a smart device 100 and at least one Bluetooth device 200. The smart device 100 has Bluetooth functionality. Among them, the smart device 100 can be a mobile terminal, such as a mobile phone, a tablet computer, etc., or a fixed terminal, such as a desktop computer, a television, etc.

[0051] In some embodiments, the smart device 100 further includes a Bluetooth module, which is used for the smart device 100 to quickly perform Bluetooth network configuration.

[0052] The Bluetooth device 200 also has Bluetooth functionality, but this Bluetooth device 200 is a playback device. That is to say, this Bluetooth device 200 has an audio playback function. The Bluetooth device 200 can be a Bluetooth headset, a Bluetooth speaker, a Bluetooth watch, etc.

[0053] In some embodiments, the Bluetooth device 200 includes a Bluetooth module, which is used for the Bluetooth device 200 to quickly perform Bluetooth network configuration.

[0054] Before this step, it is necessary to determine several Bluetooth devices that are Bluetooth-connected to the smart device. That is to say, at least one Bluetooth device and the smart device both start the Bluetooth function. The Bluetooth device sends a Bluetooth connection signal to the smart device, and this Bluetooth connection signal is used to indicate entering Bluetooth connection. This Bluetooth connection signal at least includes the Bluetooth identifier of the Bluetooth device. This Bluetooth identifier is used to uniquely determine the Bluetooth device.

[0055] Furthermore, after the smart device receives this Bluetooth connection signal, it performs a Bluetooth connection with the Bluetooth device. If the Bluetooth connection is successful, it means that the smart device and the Bluetooth device are Bluetooth paired. If the Bluetooth connection fails, it means that the smart device and the Bluetooth device are not Bluetooth paired.

[0056] In the embodiments of this application, if it is detected that the Advanced Audio Distribution Profile (A2DP) in the smart device has been started, that is, the media_a2dp_task thread in the smart device is enabled, it can be considered that the Bluetooth connection is successful. If it is detected that the Advanced Audio Distribution Profile in the smart device is paused or disabled, it can be considered that the smart device is not connected to this Bluetooth device and the Bluetooth connection fails.

[0057] In some embodiments, in order to reduce the space occupied by this Advanced Audio Distribution Profile thread, it is only started when two Bluetooth devices are successfully Bluetooth-connected to the smart device, so that the two Bluetooth devices play audio synchronously.

[0058] In some embodiments, in order to meet special groups such as disabled persons and users with weak hearing, even if only one Bluetooth device that is successfully Bluetooth-connected to the smart device, the Advanced Audio Distribution Profile thread can be started, so as to enhance the sound of the audio played by this Bluetooth device.

[0059] It should be noted that in the embodiments of this application, the number of Bluetooth devices that are successfully Bluetooth-connected to the smart device is at most two. That is to say, if there are already two Bluetooth devices that are successfully Bluetooth-connected in the smart device, such as Bluetooth speaker 1 and Bluetooth headset 2, then a third Bluetooth device such as Bluetooth watch 3, even if it has the ability to be successfully Bluetooth-connected to this smart device, this smart device cannot respond to the Bluetooth connection signal sent by this Bluetooth watch 3 and will discard the Bluetooth connection signal sent by this Bluetooth watch 3.

[0060] Specifically, after receiving the Bluetooth connection signal of at least one Bluetooth device, it is necessary to determine whether there is a network-configured Bluetooth device that has been successfully Bluetooth-connected to the smart device; if there is at most one network-configured Bluetooth device that has been successfully Bluetooth-connected to the smart device, then determine whether the advanced audio distribution thread corresponding to the Bluetooth connection signal has been started. That is to say, there are two situations. One is that the smart device is not connected to a network-configured Bluetooth device, then the smart device responds to the received Bluetooth connection signal, that is, detects whether the advanced audio distribution thread has been started. The other is that the smart device is only connected to one network-configured Bluetooth device, then the smart device can at most respond to one received Bluetooth connection signal, and also detects whether the advanced audio distribution thread has been started to determine whether the Bluetooth device is successfully Bluetooth-connected.

[0061] Of course, if there are two network-configured Bluetooth devices on the smart device, that is to say, the smart device has already been successfully connected to 2 network-configured Bluetooth devices in advance and cannot connect to the third Bluetooth device, then the smart device discards the received Bluetooth connection signal and does not perform Bluetooth connection.

[0062] In this step, if the smart device is successfully Bluetooth-connected to the Bluetooth device, the smart device establishes a channel link with the Bluetooth device for transmitting audio data. Taking the Android system as an example for the smart device in the embodiment of the present application, the smart device is based on an improved Android system architecture. The Audio Hal in the traditional Android system architecture is only a single-channel audio layer, while in the improved Android system architecture, a new single-channel audio layer is added to the original single-channel audio layer of Audio Hal, becoming a dual-channel audio layer. In this way, Audio Hal is switched to a2dp Hal. That is to say, the improved Android system is compatible with single-channel audio and dual-channel audio, thus expanding the application group and facilitating promotion.

[0063] If the smart device determines that only one Bluetooth device is successfully connected, it enables the single-channel audio channel and assigns a Bluetooth audio identifier with ID = 0 as the identifier of the single-channel audio channel. If the smart device determines that only 2 Bluetooth devices are successfully connected, it enables the dual-channel audio channel. The dual-channel audio channel includes two single-channel audio channels, called the first channel link and the second channel link, and assigns a first Bluetooth audio identifier with ID = 0 as the identifier of the first channel link and a second Bluetooth audio identifier with ID = 1 as the identifier of the second channel link. It should be noted that the Bluetooth audio identifier is not limited and can be set as needed, such as set as a specific letter.

[0064] It can be understood that if the smart device enables the dual-channel audio channel, there are Bluetooth audio channel identifiers of 0 and 1, while if the single-channel audio channel is enabled, there is only a Bluetooth audio channel identifier of 0.

[0065] Step 102: Determine the audio channel policy according to the allocated Bluetooth audio channel identifier.

[0066] In the embodiments of the present application, the audio channel policy is used to indicate whether to enable single-channel audio channel transmission of audio data or dual-channel audio channel transmission of audio data. The audio channel policy corresponding to starting a single-channel audio channel is a single-channel audio channel policy, and the audio channel policy corresponding to enabling a dual-channel audio channel is a dual-channel audio channel policy. The dual-channel audio channel policy is used to indicate that the same audio data is transmitted separately in two single-channel audio channels.

[0067] In some embodiments, when the two single-channel audio channels in the enabled dual-channel audio channel transmit the same audio data, if one of the single-channel audio channels has an abnormality, the integrity of the audio data transmission can still be ensured through the other single-channel audio channel.

[0068] In some embodiments, both single-channel audio channels are configured with a retransmission detection mechanism. The retransmission detection mechanism appropriately adjusts the transmission of audio data sent by each single-channel audio channel according to the retransmission rates of the two single-channel audio channels, such as appropriately adjusting the alternate single-channel sending mechanism according to the retransmission rate, so as to shorten the transmission time, reduce errors, and improve efficiency and accuracy.

[0069] In some embodiments, in order to reduce bandwidth, the dual-channel audio channel policy can be selected, that is, two single-channel audio channels jointly transmit an audio data, so as to shorten the transmission time and improve efficiency. It should be noted that these two single-channel audio channels are independent and do not affect each other.

[0070] In a feasible manner, the detailed steps of step 102 are:

[0071] M1021: If only the allocated Bluetooth audio channel identifier is equal to 0, establish a single-channel audio channel and use the single-channel audio channel policy as the audio channel policy.

[0072] M1022: If there is an allocated Bluetooth audio channel identifier equal to 1, establish a dual-channel audio channel and use the dual-channel audio channel policy as the audio channel policy.

[0073] That is to say, when the intelligent device only has ID = 0, it means that only one Bluetooth device is connected, and the single-channel audio channel is enabled, so as to select the single-channel audio channel policy. If there is ID = 1, it means that there is also ID = 0, and two Bluetooth devices are connected, and the dual-channel audio channel is enabled, so as to select the dual-channel audio channel policy.

[0074] It should be noted that in this embodiment, only ID = 0 or 1 is used as an example to illustrate the number of Bluetooth devices successfully connected by Bluetooth.

[0075] Step 103: Control the corresponding Bluetooth device to play the audio corresponding to the audio data according to the determined audio channel policy.

[0076] In the embodiment of the present application, based on Step 102, it is divided into two cases:

[0077] 1. The determined audio channel policy is a single-channel audio channel policy. The detailed steps of Step 103 include:

[0078] M10311: Obtain the first audio data of the single-channel audio channel;

[0079] M10312: Convert the first audio data into a first file in a standard format conforming to the Bluetooth audio transmission protocol;

[0080] M10313: Decode the first file into a first audio signal and transmit it to the Bluetooth device to play the first audio signal.

[0081] Specifically, the smart device performs Bluetooth audio transmission with the Bluetooth device through the Bluetooth protocol stack.

[0082] When enabling the single-channel audio channel, establish a communication pipeline Audio_Ctrl Socket for control instructions between the Bluetooth protocol stack and the Bluetooth service process, and send an Open instruction to the corresponding single-channel audio channel through the Audio_Ctrl Socket. If the smart device successfully receives the response to the Open instruction, send a Start instruction to the single-channel audio channel again and start to transmit audio data to the Bluetooth device connected to the smart device.

[0083] After the smart device receives the response to the Start instruction, Audio Hal establishes a data transmission pipeline Audio_Data Socket for Bluetooth service communication with the Bluetooth device, and then writes audio data to the media_Audio_task thread through the Audio_Data pipeline.

[0084] The Bluetooth protocol stack is based on the Bluetooth audio transmission protocol. Encodes the first audio data of the single-channel audio channel and converts it into a first file in a standard format conforming to the Bluetooth audio transmission protocol. Then decodes the first file to obtain the first audio signal, so that the Bluetooth device plays the first audio signal. Among them, encoding and decoding can adopt corresponding encoding algorithms and decoding algorithms.

[0085] In some embodiments, it is judged whether sound assistance is required to amplify the sound corresponding to the first audio signal played by the Bluetooth device, that is, sound amplification. If sound assistance is required, a sound assistance algorithm is also required to process the first file so that the Bluetooth device plays the processed first audio signal after sound amplification.

[0086] Second, the determined audio channel strategy is a dual-channel audio channel strategy. The refinement steps of step 103 include:

[0087] M10321: Obtain the second audio data corresponding to two single-channel audio channels respectively;

[0088] M10322: Combine the two second audio data into composite audio data by using frequency division multiplexing technology;

[0089] M10323: Convert the composite audio data into a second file in a standard format that conforms to the Bluetooth audio transmission protocol;

[0090] M10324: Decode the second file into a second audio signal and transmit it to each Bluetooth device to play the second audio signal.

[0091] Specifically, the dual-channel audio channel includes a first channel link and a second channel link. When enabling the dual-channel audio channel, establish a communication pipeline A2dp_Ctrl Socket for control instructions with the Bluetooth service process through the Bluetooth protocol stack, and send an Open instruction to the two single-channel audio channels respectively through the A2dp_Ctrl Socket. If the smart device successfully receives the response to the Open instruction, send a Start instruction to the single-channel audio channel that receives the response again, and start to transmit the second audio data to the Bluetooth device corresponding to the response.

[0092] After the smart device receives the response to the Start instruction, the A2dp Hal establishes a data transmission pipeline A2dp_Data Socket for Bluetooth service communication with the Bluetooth device, and then writes the second audio data to the media_a2dp_task thread through the A2dp_Data pipeline.

[0093] At this time, the first channel link and the second channel link respectively transmit the same second audio data. Then use frequency division multiplexing technology to combine these two second audio data into one path of composite audio data. Encode the composite audio data and convert it into a second file in a standard format that conforms to the Bluetooth audio transmission protocol, and the standard format of the Bluetooth audio transmission protocol is the SBC format. Decode the second file into a second audio signal and transmit it to each Bluetooth device to play the second audio signal.

[0094] In some embodiments, similarly determine whether sound enhancement is required, so that the sound corresponding to playing the second audio signal by any of the Bluetooth devices is amplified, that is, sound amplification. If sound enhancement is required, it is also necessary to process the second file by using a sound enhancement algorithm so that any of the Bluetooth devices plays the processed second audio signal after amplification.

[0095] It should be noted that in order to reduce the bandwidth during the transmission process, the order of sending the second audio data can be selected through the remaining memory space of two single-channel audio channels. Specifically, it is respectively determined whether the remaining memory of the first cache of the first channel link is less than a preset threshold and whether the remaining memory of the second cache of the second path link is less than the preset threshold; if there is a situation where the remaining memory of the first cache is less than the preset threshold, the sending of the second audio data of the second channel link is paused; if there is a situation where the remaining memory of the second cache is less than the preset threshold, the sending of the second audio data of the first path link is paused.

[0096] The above preset threshold is 10%. If the remaining memory of the first cache of the first channel link is less than 10%, the second audio data in the first channel link is preferentially sent, and the sending of the second audio data in the second channel link is stopped until the remaining memory of the first cache of the first channel link is greater than or equal to 10%, and the sending of the second audio data in the second channel link is allowed.

[0097] Similarly, if the remaining memory of the second cache of the second channel link is less than 10%, the second audio data in the second channel link is preferentially sent, and the sending of the second audio data in the first channel link is stopped until the remaining memory of the second cache of the second channel link is greater than or equal to 10%, and the sending of the second audio data in the first channel link is allowed.

[0098] In this way, based on steps 101 to 103, a dual-channel link is implemented through the intelligent device based on the improved Audio architecture. Instead of copying audio data in the Bluetooth protocol stack to achieve dual-channel Bluetooth audio playback, the dual-channel audio channels are started to synchronously transmit the same audio data to achieve the purpose of dual-channel Bluetooth audio playback. Moreover, due to the dual-channel audio channels, the phenomenon of audio loss can be reduced, the integrity of the data can be guaranteed, and it is further determined whether it is necessary to perform sound enhancement processing on the audio source data in different caches by judging the sound enhancement attributes set by the upper-layer application, so as to meet the needs of people with sound enhancement requirements, expand the application group, and facilitate promotion.

[0099] Please refer to Figure 3 , which is the structural block diagram of the audio playback device in the embodiment of the present application, and it includes:

[0100] The allocation unit 10 is used to allocate a Bluetooth audio channel identifier to the Bluetooth device when the Bluetooth connection with the Bluetooth device is successful;

[0101] The determination unit 20 is used to determine an audio channel policy according to the allocated Bluetooth audio channel identifier;

[0102] The control unit 30 is used to obtain audio data and control the corresponding Bluetooth device to play the audio corresponding to the audio data according to the determined audio channel policy.

[0103] It should be noted that the relevant content of the above energy-saving system can be referred to Figure 1 and Figure 2 the content described in , which will not be elaborated here.

[0104] Based on the above, the present application also provides a system for audio playback, as Figure 2 shown. The system includes a smart device 100 and at least one Bluetooth device 200. The smart device 100 is Bluetooth-connected to the Bluetooth device 200. Among them, the smart device at least includes the above-mentioned audio playback device.

[0105] Figure 4 shows the internal structure diagram of the smart device in an embodiment. The smart device can be any device capable of connecting to the network, such as a mobile phone, an iPad, a desktop computer, etc. The smart device includes a processor 20 and a memory 22 connected to the processor 20. Figure 4 Only some components of the smart device are shown, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented.

[0106] In some embodiments, the memory 22 can be the internal storage unit of the smart device, such as the memory. In some other embodiments, the memory 22 can also be an external storage device, such as a plug-in USB flash drive, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the smart device. Further, the memory 22 can also include both the internal storage unit of the smart device and the external storage device. The memory 22 is used to store the application software installed on the smart device and various types of data, such as the program code for audio playback, etc. The memory 22 can also be used to temporarily store the data that has been output or will be output. In one embodiment, a program for audio playback is stored on the memory 22, and the program for audio playback can be executed by the processor 20 as follows:

[0107] When the Bluetooth connection with the Bluetooth device is successful, allocate a Bluetooth audio channel identifier to the Bluetooth device;

[0108] Determine an audio channel policy according to the allocated Bluetooth audio channel identifier;

[0109] Obtain audio data and control the corresponding Bluetooth device to play the audio corresponding to the audio data according to the determined audio channel policy.

[0110] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which when executed by a processor, causes the processor to perform the following steps:

[0111] When the Bluetooth connection with a Bluetooth device is successful, allocate a Bluetooth audio channel identifier to the Bluetooth device;

[0112] Determine an audio channel policy according to the allocated Bluetooth audio channel identifier;

[0113] Obtain audio data, and control the corresponding Bluetooth device to play the audio corresponding to the audio data according to the determined audio channel policy.

[0114] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in this application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0115] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0116] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.

Claims

1. A method for Bluetooth audio playback, characterized in that: Applied to a smart device, the method includes: When the smart device is successfully connected to the Bluetooth device, a Bluetooth audio channel identifier is assigned to the Bluetooth device; Determine the audio channel strategy based on the assigned Bluetooth audio channel identifier; Acquire audio data, and control the corresponding Bluetooth device to play audio corresponding to the audio data according to the determined audio channel strategy; If the determined audio channel strategy is a two-way audio channel strategy, controlling the corresponding Bluetooth device to play the audio corresponding to the audio data according to the determined audio channel strategy specifically includes: Obtaining second audio data corresponding to two single audio channels respectively; Combining the two second audio data into composite audio data by using frequency division multiplexing technology; Converting the composite audio data into a second file in a standard format that complies with the Bluetooth audio transmission protocol; The second file is decoded into a second audio signal and transmitted to each Bluetooth device to play the second audio signal.

2. The method according to claim 1, characterized in that The process of successfully connecting the smart device to the Bluetooth device includes: receiving a Bluetooth connection signal from at least one Bluetooth device; If the advanced audio distribution thread corresponding to the Bluetooth connection signal has been started, determining that the Bluetooth connection between the smart device and the Bluetooth device corresponding to the Bluetooth connection signal is successful; If the advanced audio distribution thread corresponding to the Bluetooth connection signal is not started, it is determined that the Bluetooth connection between the smart device and the Bluetooth device corresponding to the Bluetooth connection signal fails.

3. The method according to claim 2, characterized in that After receiving the Bluetooth connection signal of at least one Bluetooth device, the method further includes: Determine whether the smart device has a Bluetooth device that has been successfully connected to the network; If the smart device has at most one Bluetooth device that has been successfully connected to the network, determining whether the advanced audio distribution thread corresponding to the Bluetooth connection signal has been started; If the smart device has two connected Bluetooth devices, the smart device discards the Bluetooth connection signal and does not establish a Bluetooth connection.

4. The method according to claim 1, wherein The audio channel strategy includes a single-channel audio channel strategy and a dual-channel audio channel strategy. The determining of the audio channel strategy according to the assigned Bluetooth audio channel identifier specifically includes: If only the allocated Bluetooth audio channel identifier is equal to 0, a single audio channel is established, and the single audio channel policy is used as the audio channel policy; If the allocated Bluetooth audio channel identifier is equal to 1, a dual-channel audio channel is established, and the dual-channel audio channel strategy is used as the audio channel strategy, wherein the dual-channel audio channel is two single-channel audio channels.

5. The method according to claim 4, characterized in that If the determined audio channel strategy is a single-channel audio channel strategy, controlling the corresponding Bluetooth device to play the audio corresponding to the audio data according to the determined audio channel strategy specifically includes: Acquire first audio data of the single audio channel; Converting the first audio data into a first file in a standard format that complies with the Bluetooth audio transmission protocol; The first file is decoded into a first audio signal and transmitted to the Bluetooth device to play the first audio signal.

6. The method according to claim 1, wherein The two-way audio channel includes a first channel link and a second channel link, and the determined audio channel strategy is a two-way audio channel strategy, and the method further includes: respectively determining whether the remaining memory of the first buffer of the first channel link is less than a preset threshold and whether the remaining memory of the second buffer of the second channel link is less than a preset threshold; If the remaining memory of the first buffer is less than a preset threshold, suspending the sending of the second audio data of the second channel link; If the remaining memory in the second buffer is less than a preset threshold, the sending of the second audio data of the first channel link is suspended.

7. An audio playback device, characterized in that: The device comprises: an allocating unit, configured to allocate a Bluetooth audio channel identifier to the Bluetooth device when a Bluetooth connection with the Bluetooth device is successful; a determining unit, configured to determine an audio channel strategy according to the allocated Bluetooth audio channel identifier; A control unit, configured to obtain audio data and control a corresponding Bluetooth device to play audio corresponding to the audio data according to the determined audio channel strategy; If the determined audio channel strategy is a two-way audio channel strategy, controlling the corresponding Bluetooth device to play the audio corresponding to the audio data according to the determined audio channel strategy specifically includes: Obtaining second audio data corresponding to two single audio channels respectively; Combining the two second audio data into composite audio data by using frequency division multiplexing technology; Converting the composite audio data into a second file in a standard format that complies with the Bluetooth audio transmission protocol; The second file is decoded into a second audio signal and transmitted to each Bluetooth device to play the second audio signal.

8. An audio playback system, characterized in that: The system includes a smart device and at least one Bluetooth device, wherein the smart device is connected to the Bluetooth device via Bluetooth, wherein the smart device at least includes the audio playback apparatus according to claim 7.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps in the audio playback method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for simultaneously using wired earphone and Bluetooth earphone and electronic equipment

    CN111782176A