CN113132957B - Bluetooth audio data transmission method and device, intelligent terminal and storage medium - Google Patents
Bluetooth audio data transmission method and device, intelligent terminal and storage medium Download PDFInfo
- Publication number
- CN113132957B CN113132957B CN201911410987.3A CN201911410987A CN113132957B CN 113132957 B CN113132957 B CN 113132957B CN 201911410987 A CN201911410987 A CN 201911410987A CN 113132957 B CN113132957 B CN 113132957B
- Authority
- CN
- China
- Prior art keywords
- bluetooth
- audio data
- data
- connection
- copy
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 74
- 238000000034 method Methods 0.000 title claims abstract description 35
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 238000004590 computer program Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 230000001360 synchronised effect Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/15—Setup of multiple wireless link connections
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a Bluetooth audio data transmission method, a device and a storage medium, wherein the method comprises the following steps: acquiring the connection quantity of Bluetooth equipment, and establishing Bluetooth connection channels corresponding to the Bluetooth equipment one to one according to the connection quantity; when the number of the connections is multiple, acquiring one path of audio data, and copying multiple paths of copy data corresponding to the number of the connections; and sending the audio data and the multiple paths of copy data to Bluetooth equipment through a Bluetooth connecting channel, so that each Bluetooth equipment receives one path of audio data or copy data respectively. The invention can establish the Bluetooth connection channels according to the connection quantity of the Bluetooth equipment, and does not need to acquire audio data for each Bluetooth connection channel during data transmission, thereby improving the data transmission efficiency, avoiding the audio data transmission delay, and realizing the connection of multiple Bluetooth equipment and the transmission of the audio data.
Description
Technical Field
The invention relates to the technical field of data transmission, in particular to a Bluetooth audio data transmission method and device, an intelligent terminal and a storage medium.
Background
Along with the popularization of the smart television to the Bluetooth function, the Bluetooth function becomes the standard configuration function of the smart television, and the Bluetooth sound box is the most basic function of the Bluetooth function. In the prior art, for example, with bluetooth in a television system, after a television is connected to a bluetooth speaker a and a bluetooth speaker B, when audio data is sent, audio data needs to be acquired for each path of bluetooth speaker, which affects the transmission efficiency of the audio data and results in lag in audio data transmission.
Thus, there is a need for improvement and development of the prior art.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method, an apparatus, an intelligent terminal and a storage medium for transmitting bluetooth audio data, aiming at solving the problem that in the prior art, when audio data is sent, audio data needs to be acquired for each path of bluetooth speaker, which affects the transmission efficiency of the audio data and causes the transmission delay of the audio data.
The technical scheme adopted by the invention for solving the problems is as follows:
in a first aspect, an embodiment of the present invention provides a bluetooth audio data transmission method, where the method includes:
acquiring the connection quantity of Bluetooth equipment, and establishing Bluetooth connection channels corresponding to the Bluetooth equipment one to one according to the connection quantity;
when the number of the connections is multiple, acquiring one path of audio data, and copying multiple paths of copy data corresponding to the number of the connections;
and sending the audio data and the multiple paths of copy data to Bluetooth equipment through a Bluetooth connecting channel, so that each Bluetooth equipment receives one path of audio data or copy data respectively.
In one embodiment, the acquiring the connection number of the bluetooth device and establishing a bluetooth connection channel corresponding to the bluetooth device one to one according to the connection number includes:
acquiring parameters of a preset interface used for being connected with the Bluetooth equipment;
determining the connection number of the Bluetooth equipment according to the parameters;
and establishing the Bluetooth connection channels according to the connection quantity, wherein the quantity of the Bluetooth connection channels is the same as the connection quantity, and the Bluetooth equipment corresponds to the Bluetooth connection channels one to one.
In one embodiment, said establishing said bluetooth connection channel according to said number of connections comprises:
if the connection quantity is 0, establishing a first Bluetooth connection channel;
if the connection quantity is not 0, judging whether the connection quantity exceeds a preset value or not;
and if the connection quantity does not exceed the preset value, establishing the corresponding Bluetooth connection channel according to the connection quantity.
In an embodiment, if the connection number does not exceed the preset value, establishing the corresponding bluetooth connection channel according to the connection number includes:
if the preset value is 2, when the connection quantity is not 0 and not more than 2, a second Bluetooth connection channel is established.
In one embodiment, the obtaining audio data includes:
sending a control instruction for acquiring audio data to a preset terminal which is connected with the Bluetooth device;
and receiving audio data sent by the preset terminal according to the control instruction.
In one embodiment, the step of sending the audio data and the multiple copies of data to the bluetooth device via the bluetooth connection channel includes:
sending the audio data to one of the Bluetooth connecting channels, and respectively sending the multiple paths of copy data to the remaining Bluetooth connecting channels;
and when the next data transmission is carried out, controlling the audio data and the copy data to exchange the Bluetooth connecting channel, and controlling the audio data and the copy data to repeatedly exchange the Bluetooth connecting channel in the subsequent data transmission so as to realize the repeated and alternate transmission of the data.
In one embodiment, the step of sending the audio data and the multiple copies of data to the bluetooth device via the bluetooth connection channel includes:
the audio data are sent to the Bluetooth equipment corresponding to one of the Bluetooth connecting channels, and then the multiple paths of copy data are respectively sent to the Bluetooth equipment corresponding to the rest Bluetooth connecting channels;
when the next data transmission is carried out, the audio data is sent to the Bluetooth device corresponding to any one of the Bluetooth connection channels of the copy data in the previous data transmission process, and the copy data is sent to the Bluetooth devices corresponding to the rest Bluetooth connection channels;
and when the next data transmission is repeatedly executed, the audio data is sent to the Bluetooth device corresponding to any one of the Bluetooth connection channels of the copy data in the last data transmission process, and the copy data is sent to the Bluetooth devices corresponding to the rest Bluetooth connection channels, so that repeated alternate fine data transmission is realized.
In a second aspect, an embodiment of the present invention provides a bluetooth audio data transmission apparatus, where the apparatus includes:
the connection establishing unit is used for acquiring the connection quantity of the Bluetooth equipment and establishing Bluetooth connection channels corresponding to the Bluetooth equipment one by one according to the connection quantity;
the data acquisition unit is used for acquiring one path of audio data when the number of the connections is multiple, and copying multiple paths of copy data corresponding to the number of the connections;
and the data sending unit is used for sending the audio data and the multiple paths of copy data to the Bluetooth equipment through the Bluetooth connecting channel, so that each Bluetooth equipment respectively receives one path of audio data or copy data.
In a third aspect, the present invention also provides an intelligent terminal, which includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs configured to be executed by the one or more processors include a module for executing the bluetooth audio data transmission method described in any one of the above.
In a fourth aspect, embodiments of the present invention also provide a non-transitory computer-readable storage medium, where instructions of the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the bluetooth audio data transmission method as described in any one of the above.
The invention has the beneficial effects that: the invention can establish the Bluetooth connection channels according to the connection quantity of the Bluetooth equipment, then output the audio data to the corresponding Bluetooth connection channels, when the audio data is output, firstly acquire the audio data, simultaneously copy the multi-path copy data corresponding to the connection quantity, and then send the audio data and the multi-path copy data to the Bluetooth equipment through the Bluetooth connection channels.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and it is also possible for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a flowchart illustrating a bluetooth audio data transmission method according to an embodiment of the present invention.
Fig. 2 is a schematic flowchart illustrating a bluetooth connection establishment in the bluetooth audio data transmission method according to an embodiment of the present invention.
Fig. 3 is a flowchart of a bluetooth audio data transmission method according to an embodiment of the present invention.
Fig. 4 is a schematic block diagram of a bluetooth audio data transmission apparatus according to an embodiment of the present invention.
Fig. 5 is a schematic block diagram of an internal structure of an intelligent terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It should be noted that, if directional indications (such as up, down, left, right, front, back, 8230; etc.) are involved in the embodiment of the present invention, the directional indications are only used for explaining the relative positional relationship between the components, the motion situation, etc. in a specific posture (as shown in the figure), and if the specific posture is changed, the directional indications are correspondingly changed.
In order to solve the problem that a plurality of Bluetooth devices cannot be connected simultaneously and a plurality of Bluetooth devices are utilized to output data simultaneously in the prior art, the embodiment of the invention provides a Bluetooth audio data transmission method. For example, if two connected bluetooth devices are detected, two bluetooth connection channels may be established, and then the acquired audio data may be sent to the two bluetooth connection channels, so that the bluetooth device corresponding to the bluetooth connection channel outputs the audio data.
Exemplary method
As shown in fig. 1, an embodiment of the present invention provides a bluetooth audio data transmission method, where the bluetooth audio data transmission method may be applied to an intelligent terminal, and the intelligent terminal may be an intelligent bluetooth device. In an embodiment of the present invention, the method includes the steps of:
and S100, acquiring the connection quantity of the Bluetooth devices, and establishing Bluetooth connection channels corresponding to the Bluetooth devices one to one according to the connection quantity.
In this embodiment, connection and data transmission of multiple bluetooth devices are implemented, and therefore, in this embodiment, the number of connections of the bluetooth devices needs to be obtained first, and then a corresponding bluetooth connection channel is established according to the number of connections. In this embodiment, the bluetooth device is connected to the intelligent terminal through a preset interface, so that the number of connections of the bluetooth device can be obtained by obtaining parameters of the interface.
Specifically, as shown in fig. 2, the step S100 in the present embodiment includes:
s101, acquiring parameters of a preset interface for connecting with the Bluetooth equipment;
step S102, determining the connection number of the Bluetooth equipment according to the parameters;
and S103, establishing the Bluetooth connection channels according to the connection quantity, wherein the quantity of the Bluetooth connection channels is the same as the connection quantity, and the Bluetooth devices correspond to the Bluetooth connection channels one to one.
In specific implementation, in this embodiment, the connection number of the bluetooth device is determined from the parameters according to the preset interface parameters for connecting with the bluetooth device. Specifically, as shown in fig. 3, after the bluetooth service of the bluetooth device of this embodiment is normally started, it is determined whether the current media _ a2dp _ task is started, if the media _ a2dp _ task is started, it is determined that there is a connected bluetooth device, and if the media _ a2dp _ task is not started, it is determined that there is no connected bluetooth device. Further, when it is determined that there is no connected bluetooth device, that is, the number of connections is 0, the first bluetooth connection channel is established. In one embodiment, the present embodiment sets a first code for the first bluetooth connection channel so as to distinguish between the bluetooth connection channels. For example, as shown in fig. 4, when the media _ A2DP _ task is not started successfully, an AVDTP (AUDIO/VIDEO DISTRIBUTION TRANSPORT PROTOCOL) connection is established, where the AVDTP is a PROTOCOL used to describe transmission of AUDIO/VIDEO between bluetooth devices and is a basic PROTOCOL of an A2DP PROTOCOL, and identifies that the AVDTP stream number ID is 0, that is, the first encoding set for the first bluetooth connection channel is completed. If the connected Bluetooth devices exist, namely the connection quantity is not 0, judging whether the connection quantity exceeds a preset value, and if the connection quantity does not exceed the preset value, establishing the corresponding Bluetooth connection channels according to the connection quantity. In an embodiment, if the preset value is 2, when the connection number is not 0 and is not more than 2, that is, there is only one bluetooth device, the second bluetooth connection channel is established, and each bluetooth device corresponds to one bluetooth connection channel. If the first Bluetooth device corresponds to the first Bluetooth connection channel, the second Bluetooth device corresponds to the second Bluetooth connection channel.
Further, the present embodiment sets a second code for the second bluetooth connection channel. The preset value is 2, that is, after it is determined that the bluetooth devices are connected, it is determined whether the number of the connected bluetooth devices exceeds 2, if not, that is, one bluetooth device is connected, another AVDTP connection is established, and the AVDTP stream number ID of the path is identified to be 1, that is, the second encoding set for the second bluetooth connection channel is completed.
Further, after the Bluetooth connection channel is established, the Bluetooth device sends a control instruction for acquiring audio data to a preset terminal; and then receiving audio data sent by the preset terminal according to the control instruction. Specifically, in the embodiment, the bluetooth device switches the Media Server Audio hall to the A2dp hall mode through the Audio flipper (Audio oscillator), then the A2dp Hal opens a bluetooth Audio output stream, establishes a communication pipeline A2dp _ Ctrl Socket for a control instruction with the bluetooth service process, then sends an instruction Open to each bluetooth connection channel through the A2dp _ Ctrl Socket, and after receiving a response successfully, the intelligent terminal (e.g., the smart television) sends the Start instruction again and starts to transmit Audio data. After receiving the response of the Start instruction response, the intelligent terminal (such as an intelligent television) establishes a Data transmission pipeline A2dp _ Data Socket communicated with the Bluetooth service by an A2dp Hal, and then writes audio Data into a media _ A2dp _ task thread through the A2dp _ Data Socket, namely starts to transmit the audio Data.
Further, in step S200, when the number of the connections is multiple, one path of audio data is obtained, and multiple paths of copy data are copied corresponding to the number of the connections.
In one embodiment, when the number of connections is multiple, it indicates that there are multiple connected bluetooth devices. When data transmission is performed, the embodiment first obtains one path of audio data, and copies multiple paths of copy data corresponding to the connection number. Further, in this embodiment, the audio data and the multiple paths of copy data are further encoded, and the encoded audio data and the multiple paths of copy data are stored in a preset buffer, and the audio data is stored in the buffer, so that the audio data can be more conveniently obtained when the audio data needs to be sent. Specifically, in this embodiment, after the transmitted audio data is received through the media _ a2dp _ task thread, SBC encoding is performed through the codec SBCCodec, and the encoded data (data, that is, audio data) is placed in the buffer area. And the duplicate data is obtained by directly copying the audio data, so that the duplicate data is identical to the audio data.
Further, in step S300, the audio data and the multiple paths of copy data are sent to bluetooth devices through bluetooth connection channels, so that each bluetooth device receives one path of audio data or one path of copy data respectively.
In this embodiment, the present implementation sends the audio data to one of the bluetooth connection channels, and sends the multiple paths of copy data to the remaining bluetooth connection channels, respectively; and when the next data is transmitted, controlling the audio data and the copy data to exchange a Bluetooth connection channel, and controlling the audio data and the copy data to repeatedly exchange the Bluetooth connection channel in subsequent data transmission so as to realize repeated and alternate data transmission.
Specifically, when only a first bluetooth connection channel exists, the audio data is sent to the first bluetooth connection channel, so that the bluetooth device corresponding to the first bluetooth connection channel outputs the audio data. In specific application, as shown in fig. 4, the AVDTP stream number ID may be directly obtained, and if the AVDTP stream number ID is smaller than 1, it indicates that only the first bluetooth connection channel exists, so that the audio data (data) is directly sent to the first bluetooth connection channel.
When the number of connections is multiple, because the number of connections of the bluetooth device is multiple, that is, more than one, when sending the audio data, the obtained audio data is only sent to one of the bluetooth connection channels, and for the remaining bluetooth connection channels, the embodiment sends the copy data to the remaining bluetooth connection channels. Then, when data is transmitted next time, the audio data and the copy data are controlled to be interchanged with a Bluetooth connection channel, and in subsequent data transmission, the audio data and the copy data are controlled to be interchanged with the Bluetooth connection channel repeatedly, so that repeated alternate data transmission is realized. The present embodiment realizes data alternate transmission by interchanging bluetooth connection channels for audio data and copy data. In addition, in this embodiment, only one path of bluetooth device needs to acquire the audio data, and the remaining bluetooth devices only need to copy the audio data and do not need to repeatedly acquire the audio data, thereby avoiding data delay and improving the sending efficiency of the audio data.
Further, in this embodiment, when data transmission is performed, the audio data may also be sent to the bluetooth devices corresponding to one of the bluetooth connection channels, and then the multiple paths of duplicate data are sent to the bluetooth devices corresponding to the remaining bluetooth connection channels respectively; when the next data transmission is carried out, the audio data is sent to the Bluetooth device corresponding to any one of the Bluetooth connection channels of the copy data in the last data transmission process, and the copy data is sent to the Bluetooth devices corresponding to the rest Bluetooth connection channels; and then, when the next data transmission is carried out repeatedly, the audio data is sent to the Bluetooth device corresponding to any one of the Bluetooth connection channels of the copy data in the last data transmission process, and the copy data is sent to the Bluetooth devices corresponding to the rest Bluetooth connection channels, so that the repeated alternate fine data transmission is realized. That is to say, the invention repeatedly and alternately sends the video data and the copy data, reduces the time difference of the data received by a plurality of Bluetooth devices, and leads each Bluetooth device to synchronously receive the data.
For example, when there are 2 bluetooth devices, there are bluetooth devices corresponding to the first bluetooth connection channel and bluetooth devices corresponding to the second bluetooth connection channel. When data transmission is carried out, firstly, audio data (data) are transmitted to the Bluetooth device connected with the first Bluetooth connection channel, and meanwhile, copy data (data 1) are transmitted to the second Bluetooth connection channel. In this embodiment, the copy data is obtained by copying the audio data from the preset buffer area. That is, the audio data and the copy data are the same data. Then, when data is transmitted next time, the embodiment first sends the audio data (data) to the bluetooth device connected with the second bluetooth connection channel, and then sends the copy data (data 1) to the bluetooth device connected with the first bluetooth connection channel; in the next data transmission, the audio data (data) is firstly transmitted to the bluetooth device connected with the first bluetooth connection channel, then the copy data (data 1) is transmitted to the bluetooth device connected with the second bluetooth connection channel, and the steps are repeated to realize repeated alternate transmission of the data, so that each bluetooth device can receive the data firstly in turn, the problem that the time difference is gradually accumulated and increased due to the fact that the same bluetooth device receives the data firstly all the time is avoided, the data received by the two bluetooth devices are synchronous as a whole, the problem of two-path audio asynchronization can be reduced, the quality of audio transmission is improved, and the multi-path bluetooth device connection is realized.
In summary, in the embodiments of the present invention, the bluetooth connection channels may be established according to the connection number of the bluetooth devices, and then the audio data is output to the corresponding bluetooth connection channels, when the audio data is output, the audio data is first obtained, and the multiple paths of copy data are copied according to the connection number, and then the audio data and the multiple paths of copy data are sent to the bluetooth devices through the bluetooth connection channels.
Exemplary device
As shown in fig. 4, an embodiment of the present invention provides a bluetooth audio data transmission apparatus, including: a connection establishing unit 410, a data unit 420 and a data transmitting unit 430. Specifically, the connection establishing unit 410 is configured to obtain the connection number of the bluetooth devices, and establish bluetooth connection channels corresponding to the bluetooth devices one to one according to the connection number. The data sending unit 420 is configured to, when the number of the connections is multiple, obtain one path of audio data, and copy multiple paths of copy data corresponding to the number of the connections. The data sending unit 430 is configured to send the audio data and the multiple paths of copy data to bluetooth devices through a bluetooth connection channel, so that each bluetooth device receives one path of audio data or one path of copy data.
Based on the above embodiment, the present invention further provides an intelligent terminal, and a schematic block diagram thereof may be as shown in fig. 5. The intelligent terminal comprises a processor, a memory, a network interface, a display screen and a temperature sensor which are connected through a system bus. Wherein, the processor of the intelligent terminal is used for providing calculation and control capability. The memory of the intelligent terminal comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the intelligent terminal is used for being connected and communicated with an external terminal through a network. The computer program is executed by a processor to implement a bluetooth audio data transmission method. The display screen of the intelligent terminal can be a liquid crystal display screen or an electronic ink display screen, and the temperature sensor of the intelligent terminal is arranged inside the intelligent terminal in advance and used for detecting the operating temperature of internal equipment.
It will be understood by those skilled in the art that the block diagram of fig. 5 is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation to the intelligent terminal to which the solution of the present invention is applied, and a specific intelligent terminal may include more or less components than those shown in the figure, or combine some components, or have different arrangements of components.
In one embodiment, an intelligent terminal is provided that includes a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for:
acquiring the connection quantity of Bluetooth equipment, and establishing Bluetooth connection channels corresponding to the Bluetooth equipment one to one according to the connection quantity;
when the number of the connections is multiple, acquiring one path of audio data, and copying multiple paths of copy data corresponding to the number of the connections;
and sending the audio data and the multiple paths of copy data to Bluetooth equipment through a Bluetooth connecting channel, so that each Bluetooth equipment receives one path of audio data or copy data respectively.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, databases, or other media used in embodiments provided herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
In summary, the present invention discloses a bluetooth audio data transmission method, device and storage medium, wherein the method comprises: acquiring the connection quantity of Bluetooth equipment, and establishing Bluetooth connection channels corresponding to the Bluetooth equipment one to one according to the connection quantity; when the number of the connections is multiple, acquiring one path of audio data, and copying multiple paths of copy data corresponding to the number of the connections; and sending the audio data and the multiple paths of copy data to Bluetooth equipment through a Bluetooth connecting channel, so that each Bluetooth equipment receives one path of audio data or copy data respectively. The invention can establish the Bluetooth connection channels according to the connection quantity of the Bluetooth equipment, and does not need to acquire audio data for each Bluetooth connection channel during data transmission, thereby improving the data transmission efficiency, avoiding the audio data transmission delay, and realizing the connection of multiple Bluetooth equipment and the transmission of the audio data.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.
Claims (9)
1. A method for bluetooth audio data transmission, the method comprising:
acquiring the connection quantity of Bluetooth equipment, and establishing Bluetooth connection channels corresponding to the Bluetooth equipment one to one according to the connection quantity;
when the number of the connections is multiple, acquiring one path of audio data, copying multi-path copy data corresponding to the number of the connections, encoding the audio data and the multi-path copy data, and storing the encoded audio data and the multi-path copy data in a preset cache region, wherein the encoding is performed by performing SBC encoding through a coder-decoder SBCCodec;
the audio data and the multiple paths of copy data are sent to Bluetooth equipment through a Bluetooth connecting channel, so that each Bluetooth equipment receives one path of audio data or copy data respectively;
and sending the audio data and the multi-path copy data to Bluetooth equipment through a Bluetooth connection channel, wherein the steps comprise:
the audio data are sent to the Bluetooth equipment corresponding to one of the Bluetooth connecting channels, and then the multiple paths of copy data are respectively sent to the Bluetooth equipment corresponding to the rest Bluetooth connecting channels;
when the next data transmission is carried out, the audio data is sent to the Bluetooth device corresponding to any one of the Bluetooth connection channels of the copy data in the last data transmission process, and the copy data is sent to the Bluetooth devices corresponding to the rest Bluetooth connection channels;
and when the next data transmission is repeatedly executed, the audio data is sent to the Bluetooth device corresponding to any one of the Bluetooth connection channels of the copy data in the last data transmission process, and the copy data is sent to the Bluetooth devices corresponding to the rest Bluetooth connection channels, so that repeated alternate fine data transmission is realized.
2. The method for transmitting the Bluetooth audio data according to claim 1, wherein the acquiring the connection number of the Bluetooth devices and establishing the Bluetooth connection channels corresponding to the Bluetooth devices one to one according to the connection number comprises:
acquiring parameters of a preset interface for connecting with the Bluetooth equipment;
determining the connection number of the Bluetooth equipment according to the parameters;
and establishing the Bluetooth connection channels according to the connection quantity, wherein the quantity of the Bluetooth connection channels is the same as the connection quantity, and the Bluetooth equipment corresponds to the Bluetooth connection channels one to one.
3. The method for transmitting bluetooth audio data according to claim 2, wherein the establishing the bluetooth connection channel according to the connection number comprises:
if the connection quantity is 0, establishing a first Bluetooth connection channel;
if the connection quantity is not 0, judging whether the connection quantity exceeds a preset value;
and if the connection quantity does not exceed the preset value, establishing the corresponding Bluetooth connection channel according to the connection quantity.
4. The method for transmitting bluetooth audio data according to claim 3, wherein if the connection number does not exceed the predetermined value, establishing the corresponding bluetooth connection channel according to the connection number includes:
if the preset value is 2, when the connection quantity is not 0 and not more than 2, a second Bluetooth connection channel is established.
5. The bluetooth audio data transmission method according to claim 1 or 3, wherein the acquiring of the audio data comprises:
sending a control instruction for acquiring audio data to a preset terminal which is connected with the Bluetooth device;
and receiving audio data sent by the preset terminal according to the control instruction.
6. The method for transmitting Bluetooth audio data according to claim 1, wherein the step of transmitting the audio data and the multiple copies of data to the Bluetooth device through a Bluetooth connection channel comprises:
sending the audio data to one of the Bluetooth connecting channels, and respectively sending the multiple paths of copy data to the remaining Bluetooth connecting channels;
and when the next data is transmitted, controlling the audio data and the copy data to exchange a Bluetooth connection channel, and controlling the audio data and the copy data to repeatedly exchange the Bluetooth connection channel in subsequent data transmission so as to realize repeated and alternate data transmission.
7. An apparatus for bluetooth audio data transmission, the apparatus comprising:
the connection establishing unit is used for acquiring the connection quantity of the Bluetooth equipment and establishing Bluetooth connection channels corresponding to the Bluetooth equipment one by one according to the connection quantity;
a data obtaining unit, configured to, when the number of connections is multiple, obtain one path of audio data, copy multiple paths of copy data corresponding to the number of connections, perform encoding processing on the audio data and the multiple paths of copy data, and store the encoded audio data and the multiple paths of copy data in a preset buffer area, where the encoding processing is SBC encoding through a codec SBCCodec;
the data sending unit is used for sending the audio data and the multiple paths of copy data to Bluetooth equipment through a Bluetooth connecting channel, so that each Bluetooth equipment receives one path of audio data or copy data respectively;
the data transmission unit includes:
the audio data is sent to the Bluetooth equipment corresponding to one of the Bluetooth connecting channels, and then the multiple paths of copy data are respectively sent to the Bluetooth equipment corresponding to the rest Bluetooth connecting channels;
when the next data transmission is carried out, the audio data is sent to the Bluetooth device corresponding to any one of the Bluetooth connection channels of the copy data in the previous data transmission process, and the copy data is sent to the Bluetooth devices corresponding to the rest Bluetooth connection channels;
and when the next data transmission is repeatedly executed, the audio data is sent to the Bluetooth device corresponding to any one of the Bluetooth connection channels of the copy data in the previous data transmission process, and the copy data is sent to the Bluetooth devices corresponding to the rest Bluetooth connection channels, so that repeated alternate fine data transmission is realized.
8. An intelligent terminal comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory, and wherein the one or more programs being configured to be executed by the one or more processors comprises instructions for performing the method of any of claims 1-6.
9. A non-transitory computer-readable storage medium having instructions therein, which when executed by a processor of an electronic device, enable the electronic device to perform the method of any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911410987.3A CN113132957B (en) | 2019-12-31 | 2019-12-31 | Bluetooth audio data transmission method and device, intelligent terminal and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911410987.3A CN113132957B (en) | 2019-12-31 | 2019-12-31 | Bluetooth audio data transmission method and device, intelligent terminal and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113132957A CN113132957A (en) | 2021-07-16 |
CN113132957B true CN113132957B (en) | 2023-03-10 |
Family
ID=76770277
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911410987.3A Active CN113132957B (en) | 2019-12-31 | 2019-12-31 | Bluetooth audio data transmission method and device, intelligent terminal and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113132957B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101645717A (en) * | 2009-09-07 | 2010-02-10 | 中兴通讯股份有限公司 | Method and terminal for sharing audio information by multiple users by utilizing Bluetooth headsets |
CN103096022A (en) * | 2011-11-04 | 2013-05-08 | 广达电脑股份有限公司 | Video conference system and video conference method |
CN107820325A (en) * | 2017-11-24 | 2018-03-20 | 珠海市杰理科技股份有限公司 | Wireless communications method and system, computer-readable storage medium and equipment |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2469345B (en) * | 2009-07-24 | 2011-05-04 | Wolfson Microelectronics Plc | Audio circuit |
US9615176B2 (en) * | 2012-12-28 | 2017-04-04 | Nvidia Corporation | Audio channel mapping in a portable electronic device |
US20150381296A1 (en) * | 2014-06-25 | 2015-12-31 | Cheng Yih Jenq | Wireless transmission of sound signals to multiple discrete speakers |
CN105872261B (en) * | 2016-06-15 | 2017-09-26 | 维沃移动通信有限公司 | A kind of audio frequency playing method and mobile terminal |
-
2019
- 2019-12-31 CN CN201911410987.3A patent/CN113132957B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101645717A (en) * | 2009-09-07 | 2010-02-10 | 中兴通讯股份有限公司 | Method and terminal for sharing audio information by multiple users by utilizing Bluetooth headsets |
CN103096022A (en) * | 2011-11-04 | 2013-05-08 | 广达电脑股份有限公司 | Video conference system and video conference method |
CN107820325A (en) * | 2017-11-24 | 2018-03-20 | 珠海市杰理科技股份有限公司 | Wireless communications method and system, computer-readable storage medium and equipment |
Also Published As
Publication number | Publication date |
---|---|
CN113132957A (en) | 2021-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TW201822013A (en) | Server load balancing method, apparatus, and server device | |
CN113301299B (en) | Multi-channel video transmission method, system, terminal and storage medium | |
CN113364690B (en) | Method, device, terminal and storage medium for determining network transmission path of receiving card | |
CN113114778A (en) | Data transmission method and device, electronic equipment and storage medium | |
US20210096841A1 (en) | Relay device and external device | |
CN113132957B (en) | Bluetooth audio data transmission method and device, intelligent terminal and storage medium | |
US11418430B2 (en) | QOS management system and method | |
KR102303424B1 (en) | Direct memory access control device for at least one processing unit having a random access memory | |
US8909873B2 (en) | Traffic control method and apparatus of multiprocessor system | |
US20230198648A1 (en) | Time synchronization method, device and apparatus, and storage medium | |
CN105895130A (en) | Method, device and control terminal for adjusting volume of playback equipment | |
US11089382B2 (en) | Multimedia streaming and network apparatus and operation method of the same | |
JP2005352946A (en) | Program updating method and system for communication terminal | |
CN116760504B (en) | Session synchronization method, device, service node, terminal and readable storage medium | |
US10630741B2 (en) | Communication method, storage medium storing communication program, and communication system | |
CN112953884A (en) | Method, device and apparatus for establishing access channel | |
CN115802430B (en) | Method, satellite network system and medium for switching link gateway based on mobility | |
US20250023963A1 (en) | Data transmission system | |
US20250007982A1 (en) | Vehicle data communication system, electronic control unit, and communication band setting program | |
CN114116179B (en) | A multi-task allocation batch processing method and system based on pre-calculation | |
US20250212253A1 (en) | Channel usage control for non-wifi communications | |
CN116319243A (en) | Multi-node data communication management method and system and electronic equipment | |
CN115580600A (en) | Media data transmission control method, device and storage medium | |
CN116264563A (en) | Video stream forwarding method and device, storage medium and electronic equipment | |
CN113051198A (en) | Mobile terminal module processing method and device, mobile terminal and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |