Real-time audio stream transmission method based on Bluetooth BLE protocol

By combining OPUS codec with dynamic data packaging strategy in the Bluetooth BLE protocol, the problems of low bandwidth utilization and high latency of the BLE protocol in real-time audio streaming are solved, and efficient and real-time bidirectional audio streaming is achieved at low power consumption.

CN120302267APending Publication Date: 2025-07-11SHENZHEN CHUANGYUE FUTURE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510520834.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-24
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

In real-time audio streaming, the Bluetooth BLE protocol has problems such as low bandwidth utilization, insufficient bidirectional real-time performance, and disconnection of the encoding and codec from the transmission layer, resulting in low transmission efficiency and high latency, which cannot meet the real-time needs of scenarios such as voice calls.

Method used

By encapsulating multiple OPUS format data packets into a BLE packet on the sending end and decapsulating them on the receiving end, combining the high-compression rate OPUS codec and the dynamic data packaging strategy of the BLE protocol, dynamically adjusting the MTU and connection intervals to achieve collaborative optimization of the codec and transmission layer.

Benefits of technology

It improves bandwidth utilization, reduces latency, ensures synchronization and real-time performance of bidirectional audio streams, breaks through the traditional cognitive boundaries of low-power devices, and realizes audio round-trip delay without perception in human ears under low power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120302267A_ABST
    Figure CN120302267A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of wireless communication, and discloses a real-time audio stream transmission method based on a Bluetooth BLE protocol, which comprises the following steps of: after PCM audio data is compressed through a low-delay OPUS encoder at a sending end, and a current MTU parameter is dynamically sensed, packaging a plurality of OPUS data packets into a single BLE data packet according to a first byte number identifier and an independent length identifier rule, and sending the single BLE data packet; and the receiving end restores the audio stream through reverse analysis and decodes and plays the audio stream, so that bidirectional real-time transmission is realized. According to the method, through dynamic cooperation of coding and decoding compression and protocol layer parameters, the high efficiency of OPUS coding is deeply matched with the BLE transmission characteristics, the effective load density of a single data packet is remarkably improved by utilizing a multi-packet merging and packaging strategy, the protocol interaction frequency and bandwidth fragmentation loss are reduced, and the transmission efficiency of the OPUS is improved. The efficiency bottleneck and one-way transmission limitation caused by disjunction of coding and decoding and a transmission layer in a traditional scheme are solved, and stable and reliable two-way voice interaction bottom layer support is provided for an intelligent terminal and embedded equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a real-time audio stream transmission method based on a Bluetooth BLE protocol, belonging to the technical field of wireless communications. Background Art

[0002] With the popularity of IoT devices, the Bluetooth Low Energy (BLE) protocol has been widely used in data transmission due to its low power consumption characteristics, but it has significant technical bottlenecks in real-time audio streaming transmission.

[0003] In the current industry, two methods are usually used to achieve audio transmission: one is to rely on the classic Bluetooth protocol (such as A2DP), but its power consumption is high and it cannot be adapted to embedded devices that only support BLE; the other is to directly transmit audio data based on the BLE protocol, but due to the characteristics of the protocol, there are the following problems:

[0004] 1. Low bandwidth utilization: BLE's physical layer bandwidth and maximum transmission unit (MTU) limit result in limited single payload. Existing solutions usually split audio data into multiple small packets and send them one by one. The protocol interactions are frequent and the data encapsulation is redundant, resulting in bandwidth fragmentation. For example, if the encoded OPUS data packets are not combined and encapsulated, each BLE data packet can only carry a single audio packet, resulting in a transmission efficiency of less than 60% of the actual bandwidth.

[0005] 2. Two-way real-time performance is difficult to guarantee: Traditional packet transmission requires multiple protocol handshakes, and the one-way transmission delay generally exceeds 100 milliseconds. The delay is superimposed during two-way interaction, which cannot meet the real-time requirements of scenarios such as voice calls. In addition, there is a lack of a unified data flow identification mechanism, and two-way data is prone to cross-interference.

[0006] 3. The codec and transport layers are disconnected: Existing solutions usually design codec and transport strategies independently, and do not dynamically adjust coding parameters or encapsulation logic according to MTU. For example, a fixed coding frame length may result in the encapsulated data packet not filling the MTU space, resulting in bandwidth waste; and a dynamically changing network environment (such as connection interval adjustment) may cause buffer overflow or interruption at the decoding end.

[0007] To alleviate the above problems, some solutions try to improve transmission efficiency by optimizing the codec algorithm or increasing the MTU, but such improvements still have limitations: relying solely on high-compression codecs (such as OPUS) can reduce the amount of data, but does not solve the problem of encapsulation efficiency; simply increasing the MTU may lead to an increase in the failure rate of data packet transmission, especially when the signal is unstable, which will increase delay jitter. Therefore, how to achieve dynamic coordination between codec strategies and transmission parameters under low power constraints and break through the technical bottleneck of two-way real-time audio streaming transmission has become a core issue that the industry needs to solve urgently.

[0008] Therefore, how to achieve the efficient encapsulation and low-latency transmission of two-way audio streams through the in-depth collaborative optimization of encoding / decoding and transmission protocols while maintaining low power consumption has become the technical problem to be solved by the present invention. Summary of the Invention

[0009] The present invention provides a real-time audio stream transmission method based on the Bluetooth BLE protocol, and its main purpose is to solve the problems of low bandwidth utilization, insufficient two-way real-time performance, and disconnection between encoding / decoding and the transmission layer.

[0010] To achieve the above object, a real-time audio stream transmission method based on the Bluetooth BLE protocol provided by the present invention is characterized by including the following steps:

[0011] At the sending end, audio data in the original Pulse Code Modulation (PCM) format is compressed by an OPUS encoder to generate OPUS format data packets.

[0012] At the sending end, obtain the size of the Maximum Transmission Unit (MTU) determined by the current BLE connection negotiation.

[0013] At the sending end, according to the preset data packet encapsulation rules, encapsulate multiple OPUS format data packets into one BLE data packet for sending, and the data packet encapsulation rules include:

[0014] At the first byte of the BLE data packet, record the number of OPUS format data packets encapsulated in the BLE data packet.

[0015] Before each OPUS format data packet, add one byte to record the length of the OPUS format data packet.

[0016] At the receiving end, receive the BLE data packet sent by the sending end.

[0017] At the receiving end, according to the data packet decompression rules corresponding to the sending end, decompress the received BLE data packet to restore multiple OPUS format data packets.

[0018] At the receiving end, decode the restored OPUS format data packets through an OPUS decoder to restore them to PCM format audio data, so as to achieve two-way real-time audio stream transmission between the sending end and the receiving end.

[0019] Preferably, both the OPUS encoder and the OPUS decoder are configured to provide audio encoding / decoding with high compression ratio and low latency.

[0020] Preferably, the method is applied to the audio data transmission between a smart terminal and a smart device.

[0021] Preferably, the sending end is a smart device and the receiving end is a smart terminal; or, the sending end is a smart terminal and the receiving end is a smart device.

[0022] Preferably, it further includes: dynamically adjusting the connection interval and MTU parameters of BLE at the sending end and the receiving end to optimize the bandwidth utilization rate and reduce the transmission delay.

[0023] Preferably, the step of encapsulating multiple OPUS - formatted data packets into one BLE data packet includes: cyclically taking out the OPUS - formatted data packets to be encapsulated and sequentially encapsulating them into the BLE data packet according to the data packet encapsulation rule until the BLE data packet reaches the upper limit of the MTU size.

[0024] Preferably, the step of decompressing the received BLE data packet to restore multiple OPUS - formatted data packets includes: obtaining the number of OPUS - formatted data packets encapsulated in the BLE data packet from the first byte of the received BLE data packet; and extracting each OPUS - formatted data packet one by one according to the length recorded by one byte before each OPUS - formatted data packet.

[0025] Preferably, the original PCM - formatted audio data is sourced from the microphone of a smart device.

[0026] Preferably, the restored PCM - formatted audio data is used for playing on the speaker of a smart terminal.

[0027] Compared with the problems in the background art, the beneficial effects of the present invention are:

[0028] 1. By combining the high - compression characteristics of the OPUS codec with the dynamic data encapsulation strategy under the BLE protocol, the limitation of the disconnection between the codec and the link - layer parameters in the traditional one - way transmission mode is broken through. The sending end dynamically adjusts the combined encapsulation logic of multiple OPUS data packets by real - time sensing the current MTU parameters, significantly improving the payload density of a single BLE data packet. The receiving end quickly restores the audio stream based on the predefined sub - packet identification rule, avoiding both the overhead of multiple protocol handshakes in traditional sub - packet transmission and ensuring the full play of the low - latency characteristics of the codec. This closed - loop linkage mechanism between the codec layer and the transmission layer parameters naturally forms the underlying support for two - way real - time transmission while maintaining low power consumption.

[0029] 2. Different from the conventional solutions of the fixed encapsulation mode, the present invention deeply couples the dynamic negotiation result of the BLE connection interval and the MTU in the data encapsulation link. The sender adaptively adjusts the loading quantity and arrangement mode of the OPUS sub-packets in each data packet according to the real-time link state, so that the transmission efficiency always approaches the upper limit of the current channel capacity. This mechanism of dynamically matching the codec output rate with the physical layer transmission capacity not only effectively avoids the bandwidth fragmentation problem caused by improper MTU setting, but also reduces the overall power consumption by reducing the invalid padding data, ensuring that stable two-way audio stream synchronization can still be maintained under complex working conditions such as device movement and signal fluctuation.

[0030] 3. By embedding the OPUS sub-packet quantity identifier and the independent length identifier in the encapsulation structure, the receiver only needs to perform a single parsing to accurately restore the original data stream topology. This two-level identifier mechanism cleverly balances the packet header overhead and the parsing efficiency, enabling the data packets of the two-way audio stream in the same transmission channel to be unambiguously identified and recombined. Compared with the cumbersome processing relying on timestamps or independent channels in the traditional scheme, the present invention maintains an extremely low protocol overhead while naturally avoiding the inter-stream interference that may be caused by the cross-transmission of two-way data, providing an underlying guarantee for real-time voice interaction.

[0031] 4. From PCM acquisition to OPUS encoding and then to dynamic encapsulation transmission, the present invention constructs a complete low-complexity processing chain. The sender significantly reduces the amount of original data through high-compression-rate encoding, and the receiver uses the predictive decoding strategy to offset the impact of transmission jitter. This end-to-end collaborative design globally optimizes the codec delay and the transmission delay at the system level. Under the inherent connection interval limitation of the BLE protocol, it can still achieve an inaudible audio round-trip delay for the human ear, breaking through the traditional cognitive boundary that low-power devices are difficult to support real-time two-way voice. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a flowchart of the real-time audio stream two-way transmission method based on the Bluetooth BLE protocol of the present invention.

[0033] Figure 2 It is a data compression flowchart of the real-time audio stream transmission method based on the Bluetooth BLE protocol of the present invention.

[0034] Figure 3 It is a flowchart of the BLE data packet compression of the present invention.

[0035] Figure 4 It is a flowchart of the BLE data packet decompression of the present invention.

[0036] Figure 5 It is a schematic diagram of the BLE data packet structure of the present invention.

[0037] Figure 6This is the data flow diagram of the two-way transmission of real-time audio stream based on the Bluetooth BLE protocol in the present invention.

[0038] The implementation, functional features and advantages of the present invention will be further described with reference to the embodiments and the accompanying drawings. Detailed implementation manners

[0039] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0040] The embodiment of the present application provides a method for real-time audio stream transmission based on the Bluetooth BLE protocol, and its main purpose is to solve the problems of low bandwidth utilization, insufficient two-way real-time performance, and disconnection between the encoding / decoding layer and the transmission layer.

[0041] To achieve the above object, a method for real-time audio stream transmission based on the Bluetooth BLE protocol provided by the present invention is characterized by including the following steps:

[0042] At the sending end, the audio data in the original Pulse Code Modulation (PCM) format is compressed by an OPUS encoder to generate OPUS format data packets.

[0043] At the sending end, obtain the size of the Maximum Transmission Unit (MTU) determined by the current BLE connection negotiation.

[0044] At the sending end, according to the preset data packet encapsulation rules, encapsulate multiple OPUS format data packets into a BLE data packet for sending. The data packet encapsulation rules include:

[0045] At the first byte of the BLE data packet, record the number of OPUS format data packets encapsulated in the BLE data packet.

[0046] Before each OPUS format data packet, add one byte to record the length of the OPUS format data packet.

[0047] At the receiving end, receive the BLE data packet sent by the sending end.

[0048] At the receiving end, according to the data packet decompression rules corresponding to the sending end, decompress the received BLE data packet to restore multiple OPUS format data packets.

[0049] At the receiving end, decode the restored OPUS format data packets through an OPUS decoder to restore them to PCM format audio data, so as to realize the two-way real-time audio stream transmission between the sending end and the receiving end.

[0050] Preferably, both the OPUS encoder and the OPUS decoder are configured to be able to provide audio encoding and decoding with high compression ratio and low latency.

[0051] Preferably, the method is applied to the audio data transmission between a smart terminal and a smart device.

[0052] Preferably, the sending end is a smart device and the receiving end is a smart terminal; or, the sending end is a smart terminal and the receiving end is a smart device.

[0053] Preferably, it further includes: dynamically adjusting the connection interval and MTU parameters of BLE at the sending end and the receiving end to optimize the bandwidth utilization rate and reduce the transmission delay.

[0054] Preferably, the step of encapsulating multiple OPUS-format data packets into one BLE data packet includes: circularly taking out the OPUS-format data packets to be encapsulated and sequentially encapsulating them into the BLE data packet according to the data packet encapsulation rule until the BLE data packet reaches the upper limit of the MTU size.

[0055] Preferably, the step of decompressing the received BLE data packet to restore multiple OPUS-format data packets includes: obtaining the number of OPUS-format data packets encapsulated in the BLE data packet from the first byte of the received BLE data packet; and extracting each OPUS-format data packet one by one according to the length recorded by the byte before each OPUS-format data packet.

[0056] Preferably, the original PCM-format audio data is from the microphone of a smart device.

[0057] Preferably, the restored PCM-format audio data is used for playing on the speaker of a smart terminal.

[0058] Embodiment 1: In a smart home environment, with the wide application of Bluetooth Low Energy (BLE) technology, real-time audio transmission between devices has become the basis for realizing functions such as smart voice assistants and remote voice control. However, due to the bandwidth and transmission delay limitations of the BLE protocol, traditional audio stream transmission schemes face significant technical bottlenecks in two-way real-time voice interaction. Audio data in the prior art is usually packetized at a low transmission efficiency, resulting in bandwidth waste and increased delay. Especially in complex scenarios with multiple device interactions, voice delay and synchronization problems between different devices are likely to occur.

[0059] The real-time audio stream transmission method based on the BLE protocol in this embodiment combines high-compression-rate OPUS encoding with a dynamic encapsulation strategy, which can effectively improve the bandwidth utilization rate, reduce the delay, and ensure the synchronization of two-way audio streams. The following is the specific implementation of this technical solution in practical applications.

[0060] Suppose in a smart home environment, the user conducts voice interaction with smart home appliances (such as a smart refrigerator) in the home through a smart speaker (a smart terminal). The smart speaker, as the receiving end, can receive voice commands from the user and decode them; the smart refrigerator, as the sending end, collects the audio of the user's commands in real time through a built-in microphone and transmits the audio data to the smart speaker for playback and feedback through the method described in the present invention.

[0061] Operation of the sending end: The smart refrigerator captures the user's voice command through a built-in microphone to form the original PCM audio data. To improve the transmission efficiency, the smart refrigerator uses an OPUS encoder to compress this audio data into audio packets in OPUS format. The OPUS encoder not only provides a high compression ratio during this process but also ensures low latency to meet the requirements of real-time voice interaction. At the same time, the smart refrigerator dynamically senses the size of the maximum transmission unit (MTU) according to the current BLE connection status and decides how to encapsulate multiple OPUS data packets based on this information. For example, in a low-latency network state, the smart refrigerator may choose to merge multiple OPUS audio packets into one BLE data packet for transmission. The encapsulation rule for each data packet includes: recording the quantity and length information of the OPUS data packets to ensure that the receiving end can correctly parse them.

[0062] Operation of the receiving end: After receiving the BLE data packet from the smart refrigerator, the smart speaker parses the BLE data packet through the reverse de-encapsulation rule to restore the OPUS format data packet therein. The smart speaker decodes the audio data into PCM format through an OPUS decoder and then plays back the feedback content of the voice command through a speaker. To cope with the dynamic network environment, the smart speaker and the smart refrigerator will adaptively adjust the MTU parameter and the BLE connection interval according to the actual link conditions, thereby optimizing the bandwidth utilization rate, reducing latency, and improving the fluency of voice interaction.

[0063] Embodiment 2: With the development of telemedicine technology, voice interaction between patients and doctors has become particularly important, especially in some remote areas where patients cannot conveniently go to the hospital for face-to-face consultations and diagnoses. In these scenarios, how to ensure clear and real-time voice calls through low-power devices is a key issue in ensuring medical quality and improving the patient experience.

[0064] This embodiment describes how to achieve low-latency and two-way audio transmission through a real-time audio stream transmission method based on the Bluetooth BLE protocol in a telemedicine monitoring system, ensuring efficient and stable voice communication between doctors and patients.

[0065] For example, a patient wears a smart health bracelet with a built-in microphone that can collect the patient's voice data in real time. When the patient needs to consult a doctor remotely, the smart health bracelet, as the sender of audio data, transmits the patient's voice data to the doctor's smartphone or tablet device via the BLE protocol. The doctor's device plays the voice through a speaker and gives feedback, and the doctor can also communicate with the patient in two-way real-time voice through the microphone. The implementation method is as follows:

[0066] Sender operation: The smart health bracelet collects the patient's voice signal in real time through the built-in microphone and generates raw PCM-format audio data. At this time, the OPUS encoder on the smart health bracelet compresses the PCM data to generate multiple OPUS data packets. To make more efficient use of the limited bandwidth of BLE, the smart health bracelet combines multiple OPUS data packets into one BLE data packet according to the negotiated maximum transmission unit (MTU) size and sends it using the multi-pack-into-one algorithm. The encapsulation rules at the sender include: recording the number of OPUS packets in the first byte of the BLE data packet and adding one byte before each OPUS data packet to record the length of the packet, ensuring that the receiving end can quickly parse and restore the original audio stream based on these identifiers.

[0067] Receiver operation: After receiving the BLE data packet from the smart health bracelet, the doctor's smartphone or tablet device transmits the data to the application via the BLE protocol. The receiving end decompresses the BLE data packet. First, it reads the first byte to obtain the number of OPUS data packets, and then extracts and restores each OPUS data packet one by one according to the length information of each packet. Then, the receiving end uses the OPUS decoder to decode multiple OPUS data packets into PCM audio data and plays it through the speaker. The doctor can hear the patient's voice and give a diagnostic feedback. During this process, the doctor can also collect voice data in real time through the device's microphone, give feedback and transmit it back to the patient's end via the same BLE protocol to achieve two-way real-time voice calls, which are all extended implementation methods known to those of ordinary skill in the art.

[0068] Example 3: This example aims to comprehensively refer to Appendix Figure 1 to Appendix Figure 6 and specifically describe the real-time audio stream transmission method based on the Bluetooth BLE protocol.

[0069] See Figure 1, which shows a method for two-way transmission of real-time audio streams based on the Bluetooth BLE protocol. On the smart device side, the audio data source 1 (such as microphone data) is acquired to obtain the original audio data packets in PCM format. The BLE server uses the OPUS encoder to encode the audio data packets in PCM format into OPUS format audio data packets, and according to the maximum BLE MTU size, performs a compression algorithm on multiple OPUS data packets to compress multiple OPUS data packets into a single BLE data packet, and then sends the single BLE data packet. The wireless transmission data is transmitted between the BLE server and the BLE client. On the BLE client of the smart terminal, the single BLE data packet is received, and a decompression algorithm is performed on the single BLE data packet to decompress multiple OPUS data packets. Then, the OPUS decoder is used to decode the OPUS data packets into audio data packets in PCM format to obtain the original audio data packets in PCM format, and finally the audio data source 1 (such as microphone data) is output.

[0070] During the reverse transmission process, the audio data source 2 (such as speaker data) is acquired on the smart device side to obtain the original audio data packets in PCM format. The BLE server uses the OPUS encoder to encode the audio data packets in PCM format into OPUS format audio data packets, and according to the maximum BLE MTU size, performs a compression algorithm on multiple OPUS data packets to compress multiple OPUS data packets into a single BLE data packet, and then sends the single BLE data packet. The BLE client of the smart terminal receives this BLE data packet. On the smart terminal, a decompression algorithm is performed on the single BLE data packet to decompress multiple OPUS data packets. Then, the OPUS decoder is used to decode the OPUS data packets into audio data packets in PCM format to obtain the original audio data packets in PCM format, and the audio data source 2 (such as speaker data) is output through the audio output device.

[0071] See Figure 2 See the data compression process of the real-time audio stream transmission method based on the Bluetooth BLE protocol shown in. The process starts from the smart device. First, the BLE server acquires the original audio data packets in PCM format. Then, the OPUS encoder is used to encode the audio data packets in PCM format into OPUS format audio data packets. Then, according to the maximum BLE MTU size, a compression algorithm is performed on multiple OPUS data packets to compress multiple OPUS data packets into a single BLE data packet. Finally, the single BLE data packet is sent and transmitted to the smart terminal through the wireless transmission data. On the smart terminal, the BLE server receives this BLE data packet and performs subsequent decompression and decoding operations to finally obtain the original audio data packets in PCM format, that is, the audio data source 1 (such as microphone data).

[0072] See Figure 3This is a flowchart for BLE packet compression, showing the detailed steps of compressing multiple OPUS packets into one BLE packet. The process starts from the start box. First, the BLE MTU size is obtained. Then, the compression data structures (such as opus_count, opus_length, etc.) are initialized to prepare for the subsequent compression process. The key step is to loop through the OPUS packets and write them into the BLE packet. In this loop, two judgments are made: 1. Determine if the MTU is exceeded → if exceeded, send the current packet and create a new next packet, and 2. Update opus_count. After the loop is completed, the BLE packet is sent, and the process ends at the end box.

[0073] See Figure 4 This is a flowchart for BLE packet decompression, showing the detailed steps of how the receiving end decompresses OPUS packets from the received BLE packet. The process starts from the start box. First, the BLE packet is received. Then, the key step is to read the first byte (opus_count) of the BLE packet, which is used to obtain the number of OPUS packets encapsulated in the BLE packet. Next, enter the loop to decompress the OPUS packets. Three operations are performed within the loop: 1. Read opus_length, 2. Read the OPUS data, and 3. Store the OPUS packet in the decompression queue. After the loop ends, the process ends at the end box.

[0074] See Figure 5 This is a schematic diagram of the BLE packet structure, showing in detail the composition structure of the BLE packet. The whole figure is labeled as the BLE packet. The data in the packet is organized according to byte indices and corresponding contents. Specifically, the content of byte index 1 is the number of compressed OPUS packets in the current BLE packet. The content of byte index 2 is the length of the first OPUS packet (assumed length is a). The content of byte indices [3, 2 + a] is the first OPUS packet. The content of byte index 3 + a is the length of the second OPUS packet (assumed length is b). The content of byte indices [4 + a, 3 + a + b] is the second OPUS packet. The content of byte index 4 + a + b is the length of the third OPUS packet (assumed length is c). The content of byte indices [5 + a + b, 4 + a + b + c] is the third OPUS packet. Ellipsis is used at the bottom of the figure to indicate... more OPUS packets.

[0075] See Figure 6It is the data flow direction of two-way real-time audio stream transmission based on the Bluetooth BLE protocol. The figure is divided into two main data flow directions. Audio data source 1 data flow (intelligent terminal -> intelligent device): The audio data source 1 is first processed by the software in the intelligent terminal, then transmitted to the microprocessor through the Bluetooth BLE protocol, and the microprocessor then passes the processed audio data to the speaker for audio playback (audio data source 1), and finally realizes the audio playback. Audio data source 2 data flow (intelligent device -> intelligent terminal): The audio data source 2 is first received and processed by the microprocessor, then transmitted to the software in the intelligent terminal through the Bluetooth BLE protocol, and the software in the intelligent terminal then passes the processed audio data to the microphone for audio acquisition (audio data source 2), completing the audio acquisition.

[0076] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and without departing from the spirit or basic characteristics of the present invention, the present invention can be implemented in other specific forms.

[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A real-time audio stream transmission method based on the Bluetooth BLE protocol, characterized in that It includes the following steps: At the sending end, the audio data in the original Pulse Code Modulation (PCM) format is compressed by an OPUS encoder to generate OPUS format data packets. At the sending end, obtain the maximum transmission unit (MTU) size determined by the current BLE connection negotiation. At the sending end, according to the preset data packet encapsulation rules, encapsulate multiple OPUS format data packets into one BLE data packet for sending. The data packet encapsulation rules include: At the first byte of the BLE data packet, record the number of OPUS format data packets encapsulated in the BLE data packet. Before each OPUS format data packet, add one byte to record the length of the OPUS format data packet. At the receiving end, receive the BLE data packet sent by the sending end. At the receiving end, according to the data packet decompression rules corresponding to the sending end, decompress the received BLE data packet to restore multiple OPUS format data packets. At the receiving end, decode the restored OPUS format data packets through an OPUS decoder to restore them to PCM format audio data, so as to realize two-way real-time audio stream transmission between the sending end and the receiving end.

2. The real-time audio stream transmission method based on Bluetooth BLE protocol according to claim 1, characterized in that, The method is applied to the audio data transmission between a smart terminal and a smart device.

3. A real-time audio stream transmission method based on the Bluetooth BLE protocol according to claim 1, characterized in that The sending end is a smart device and the receiving end is a smart terminal; or the sending end is a smart terminal and the receiving end is a smart device.

4. The real-time audio stream transmission method based on the Bluetooth BLE protocol according to claim 1, wherein The step of encapsulating multiple OPUS format data packets into one BLE data packet includes: cyclically taking out the OPUS format data packets to be encapsulated and encapsulating them into the BLE data packet in sequence according to the data packet encapsulation rules until the BLE data packet reaches the upper limit of the MTU size.

5. A real-time audio stream transmission method based on the Bluetooth BLE protocol according to claim 1, characterized in that, The step of decompressing the received BLE data packet to restore multiple OPUS format data packets includes: obtaining the number of OPUS format data packets encapsulated in the BLE data packet from the first byte of the received BLE data packet; extracting each OPUS format data packet one by one according to the length recorded by one byte before each OPUS format data packet.

6. The real-time audio stream transmission method based on the Bluetooth BLE protocol according to claim 1, wherein, The original PCM format audio data is from the microphone of the smart device.

7. A real-time audio stream transmission method based on the Bluetooth BLE protocol according to claim 1, characterized in that, The restored PCM format audio data is used for playing on the speaker of the smart terminal.