CN111132111A - BLE-based audio sharing method and system and computer-readable storage medium - Google Patents
BLE-based audio sharing method and system and computer-readable storage medium Download PDFInfo
- Publication number
- CN111132111A CN111132111A CN201911387711.8A CN201911387711A CN111132111A CN 111132111 A CN111132111 A CN 111132111A CN 201911387711 A CN201911387711 A CN 201911387711A CN 111132111 A CN111132111 A CN 111132111A
- Authority
- CN
- China
- Prior art keywords
- ble
- audio data
- target slave
- host
- audio
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000004891 communication Methods 0.000 abstract description 17
- 238000010586 diagram Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 8
- 238000004590 computer program Methods 0.000 description 7
- 238000012986 modification Methods 0.000 description 6
- 230000004048 modification Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 230000006835 compression Effects 0.000 description 3
- 238000007906 compression Methods 0.000 description 3
- 239000004020 conductor Substances 0.000 description 3
- 230000006837 decompression Effects 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 238000012795 verification Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
- 230000002618 waking 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
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R1/00—Details of transducers, loudspeakers or microphones
- H04R1/10—Earpieces; Attachments therefor ; Earphones; Monophonic headphones
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
-
- 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)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Physics & Mathematics (AREA)
- Acoustics & Sound (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses an audio sharing method, system and computer readable storage medium based on Bluetooth low energy BLE, wherein the method comprises the following steps: after one or more slave machines scan the broadcast signals sent by the BLE host machine, the slave machines which scan the broadcast signals are judged as target slave machines, and the target slave machines are connected with the BLE host machine and receive the audio data packets. After the target slave is connected to the BLE host, the audio data packet is decompressed and the audio data is played in a preset mode and proportion, and therefore the purpose that the BLE host is directly connected in a scanning mode without pairing is achieved, and the playing audio data is obtained. Meanwhile, a plurality of target slave machines can be simultaneously connected with the BLE host machine to play audio data, and audio sharing is achieved. In addition, the target slave and the BLE host are in communication connection through BLE, and the power consumption of the target slave is lower than that of a TWS (two way communication) headset or a classic Bluetooth headset.
Description
Technical Field
The present invention relates to the field of wireless bluetooth headsets, and in particular, to a BLE-based audio sharing method and system, and a computer-readable storage medium.
Background
With the development and modern times of the bluetooth technology and the manufacturing process, people have increasingly high pursuit for light and fast life, and the wireless bluetooth headset solves the problem that the traditional headset wire is always wound together and occupies a large space, so that the wireless bluetooth headset is more and more widely used. At present, the wireless Bluetooth headset is mainly a TWS headset, also called a real wireless Bluetooth headset, and has the problem of high transmission power consumption; and the TWS earphone can only realize one-to-one connection, namely, one Bluetooth terminal device can only be connected with one pair of Bluetooth earphones. Therefore, the wireless bluetooth headset in the current market has the problems that only a single user is supported to connect the bluetooth terminal device to play audio, multiple users are not allowed to simultaneously connect the same terminal to perform audio playing experience, and audio sharing cannot be realized, besides high transmission power consumption.
Disclosure of Invention
The invention mainly aims to provide an audio sharing method, an audio sharing system and a computer readable storage medium based on BLE, and aims to solve the technical problems that power consumption generated in the data transmission process of the existing Bluetooth headset is high, only one Bluetooth terminal device can be connected with a pair of Bluetooth headsets at the same time, and audio sharing of audio playing of a plurality of pairs of headsets is not allowed.
In order to achieve the above object, the present invention provides an audio sharing method based on bluetooth low energy BLE, where the audio sharing method based on BLE includes the following steps:
when a target slave which scans a broadcast signal sent by a BLE host exists in a plurality of slaves, the target slave is connected with the BLE host and receives an audio data packet sent by the BLE host;
the target slave computer decompresses the audio data packet based on a preset mode and a preset proportion to generate audio data;
and the target slave machine plays the audio data.
Preferably, when there is a target slave which scans a broadcast signal transmitted by a BLE master from among the plurality of slaves, the step of the target slave connecting to the BLE master is preceded by:
scanning a preset channel by the plurality of slave machines, and detecting whether any slave machine in the plurality of slave machines receives a broadcast signal which is sent by the BLE host machine and carries a preset mark;
if any slave machine receives the broadcast signal, the slave machine is determined to be a target slave machine which scans the broadcast signal transmitted by the BLE host machine.
Preferably, the step of connecting the target slave to the BLE master and receiving the audio data packet sent by the BLE master comprises:
the target slave machine displays a device name corresponding to the preset mark on a display screen of the target slave machine, wherein the device name is the name of the BLE host machine;
when the target slave receives a connection request instruction sent based on the displayed equipment name, connection between the target slave and the BLE host is established, and an audio data packet sent by the BLE host is received.
Preferably, the target slave comprises a left earphone and a right earphone; the step of establishing connection between the target slave and the BLE master when the target slave receives a connection request command transmitted based on the displayed device name includes:
when the target slave machine receives a connection request instruction sent based on the displayed equipment name, judging the earphone attribute in the connection request instruction;
if the earphone attribute in the connection request instruction is a left ear attribute, establishing connection between the left earphone and the BLE host;
and if the earphone attribute in the connection request instruction is a right ear attribute, establishing the connection between the right earphone and the BLE host.
Preferably, the step of receiving the audio data packet transmitted by the BLE host comprises:
and the target slave acquires the address of the BLE host and receives the audio data packet sent by the BLE host in the broadcast signal according to the address.
Preferably, the target slave device decompresses the audio data packet based on a preset mode and a preset proportion, and the step of generating the audio data includes:
the target slave machine judges whether the audio data packet is received or not;
and if the audio data packet is received, decompressing the audio data packet based on the preset mode and the preset proportion to generate audio data.
In order to achieve the above object, the present invention further provides a BLE-based audio sharing method, where the method includes:
when the BLE host receives original audio data, compressing the original audio data into audio data packets based on a preset mode and a preset proportion;
the BLE host sends the audio data packet to a plurality of slaves.
Preferably, the step of the BLE master sending the audio data packet to a plurality of slaves includes:
and the BLE host sends the audio data packet to a plurality of slave machines based on a broadcast signal according to a preset broadcast interval.
In order to achieve the above object, the present invention further provides a BLE-based audio sharing system, where the BLE-based audio sharing system includes a BLE master and a plurality of slaves, and includes a processor and a memory, where the memory stores a control program, and the control program is executed by the processor and implements the steps of the BLE-based audio sharing method.
In addition, to achieve the above object, the present invention further provides a computer-readable storage medium for storing a control program, which is executed by a processor and implements the steps of the BLE-based audio sharing method.
According to the audio sharing method and system based on BLE and the computer readable storage medium provided by the embodiment of the invention, after one or more slave machines scan the broadcast signal sent by the BLE host machine independently, the slave machine which scans the broadcast signal is judged as a target slave machine, and the target slave machine is connected with the BLE host machine and receives the audio data packet. After the target slave is connected to the BLE host, the audio data packet is decompressed and the audio data is played in a preset mode and proportion, and therefore the purpose that the BLE host is directly connected in a scanning mode without pairing is achieved, and the playing audio data is obtained. Meanwhile, a plurality of target slave machines can be simultaneously connected with the BLE host machine to play audio data, and audio sharing is achieved. In addition, the target slave and the BLE host are in communication connection through BLE, and the power consumption of the target slave is lower than that of a TWS (two way communication) headset or a classic Bluetooth headset.
Drawings
FIG. 1 is a schematic diagram of the internal structure connection of an audio sharing system in a hardware operating environment according to an embodiment of the present invention;
figure 2 is a flowchart illustrating a BLE-based audio sharing method according to a first embodiment of the present invention;
figure 3 is a flowchart illustrating a BLE-based audio sharing method according to a second embodiment of the present invention;
figure 4 is a flowchart illustrating a BLE-based audio sharing method according to a third embodiment of the present invention;
figure 5 is a schematic flow chart of a security verification mechanism according to a fourth embodiment of the BLE-based audio sharing method of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: after one or more slave machines scan the broadcast signals sent by the BLE host machine, the slave machines which scan the broadcast signals are judged as target slave machines, and the target slave machines are connected with the BLE host machine and receive the audio data packets. After the target slave is connected to the BLE host, the audio data packet is decompressed and the audio data is played in a preset mode and proportion, and therefore the purpose that the BLE host is directly connected in a scanning mode without pairing is achieved, and the playing audio data is obtained. Meanwhile, a plurality of target slave machines can be simultaneously connected with the BLE host machine to play audio data, and audio sharing is achieved. In addition, the target slave and the BLE host are in communication connection through BLE, and the power consumption of the target slave is lower than that of a TWS (two way communication) headset or a classic Bluetooth headset.
Referring to fig. 1, fig. 1 is a schematic diagram of internal structural connections of a BLE-based audio sharing system in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the slave may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the internal structure of the BLE-based audio sharing system shown in fig. 1 does not constitute a limitation of the BLE-based audio sharing system, and may include more or fewer components than those shown, or combine certain components, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a control program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call the control program stored in the memory 1005 and perform the following operations:
when a target slave which scans a broadcast signal sent by a BLE host exists in a plurality of slaves, the target slave is connected with the BLE host and receives an audio data packet sent by the BLE host;
the target slave computer decompresses the audio data packet based on a preset mode and a preset proportion to generate audio data;
and the target slave machine plays the audio data.
Further, when there is a target slave in the plurality of slaves that scans for a broadcast signal transmitted by the BLE master, the processor 1001 may be configured to call a control program stored in the memory 1005 and perform the following operations before the step of connecting the target slave to the BLE master:
scanning a preset channel by the plurality of slave machines, and detecting whether any slave machine in the plurality of slave machines receives a broadcast signal which is sent by the BLE host machine and carries a preset mark;
if any slave machine receives the broadcast signal, the slave machine is determined to be a target slave machine which scans the broadcast signal transmitted by the BLE host machine.
Further, the step that the target slave is connected with the BLE host and receives the audio data packet sent by the BLE host comprises:
the target slave machine displays a device name corresponding to the preset mark on a display screen of the target slave machine, wherein the device name is the name of the BLE host machine;
when the target slave receives a connection request instruction sent based on the displayed equipment name, connection between the target slave and the BLE host is established, and an audio data packet sent by the BLE host is received.
Further, the target slave includes a left earphone and a right earphone; the step of establishing connection between the target slave and the BLE master when the target slave receives a connection request command transmitted based on the displayed device name includes:
when the target slave machine receives a connection request instruction sent based on the displayed equipment name, judging the earphone attribute in the connection request instruction;
if the earphone attribute in the connection request instruction is a left ear attribute, establishing connection between the left earphone and the BLE host;
and if the earphone attribute in the connection request instruction is a right ear attribute, establishing the connection between the right earphone and the BLE host.
Further, the step of receiving the audio data packet sent by the BLE host comprises:
and the target slave acquires the address of the BLE host and receives the audio data packet sent by the BLE host in the broadcast signal according to the address.
Further, the target slave computer decompresses the audio data packet based on a preset mode and a preset proportion, and the step of generating the audio data comprises:
the target slave machine judges whether the audio data packet is received or not;
and if the audio data packet is received, decompressing the audio data packet based on the preset mode and the preset proportion to generate audio data.
Further, the processor 1001 may call the control program stored in the memory 1005 to perform the following operations:
when the BLE host receives original audio data, compressing the original audio data into audio data packets based on a preset mode and a preset proportion;
the BLE host sends the audio data packet to a plurality of slaves.
Further, the step of the BLE master sending the audio data packet to a plurality of slaves includes:
and the BLE host sends the audio data packet to a plurality of slave machines based on a broadcast signal according to a preset broadcast interval.
For a better understanding of the above technical solutions, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Referring to fig. 2, fig. 2 is a flowchart illustrating a BLE-based audio sharing method according to a first embodiment of the present invention. In this embodiment, the audio sharing method includes the steps of:
step S10, when a target slave that scans a broadcast signal sent by a BLE master exists in a plurality of slaves, the target slave is connected to the BLE master and receives an audio data packet sent by the BLE master;
the audio sharing method based on BLE in this embodiment is applied to a system composed of a BLE master and a plurality of slaves, the BLE master is a hardware terminal which can receive raw audio data and transmit the processed data as broadcast signals, the hardware terminal has a receiving port for connecting terminals such as a computer and a network television, and can transmit the broadcast signals to use BLE for communication connection after the slave scans, and the slaves are a pair of bluetooth earphones. The BLE host and the slave are both provided with a BLE (Bluetooth Low Energy) module for supporting the communication connection, and the BLE host and the slave are in communication connection through the BLE so as to realize the function of sharing the audio of the BLE host to the slaves.
Further, the slave machine comprises a receiving antenna module which is used for scanning the broadcast signals sent by the BLE host machine; the slave machine also comprises a display screen which is applied to the display of the earphone information and the sending message. The BLE host machine sends the broadcast signals to the plurality of slave machines based on preset broadcast intervals by using a sending antenna module arranged in the BLE host machine; the channels transmitted therein are preset by the bluetooth protocol, preferably 37, 38 and 39 channels. The plurality of slaves scan in 37, 38 and 39 channels specified by the Bluetooth protocol based on the receiving antenna module arranged in the slaves; in addition, the broadcast signal transmitted by the BLE host carries a BLE host device name, which can be identified by a device identification flag, such as the device identification flag a. After the plurality of slave machines start scanning, whether the slave machines scan the broadcast signals carrying the BLE host machine name containing the equipment identification mark A or not is judged, and when the slave machines scan the broadcast signals carrying the BLE host machine name containing the equipment identification mark A, the slave machines scanning the broadcast signals are judged as target slave machines. The target slave displays the BLE host equipment name containing the equipment identification mark A on a display screen so as to enable a user to select the equipment name. When receiving a connection request instruction sent by a user selection device name, the target slave machine establishes connection with the BLE host machine and receives audio data sent by the BLE host machine.
Step S20, the target slave computer decompresses the audio data packet based on a preset mode and a preset proportion to generate audio data;
furthermore, audio codecs are arranged in both the BLE master and the target slave, and are respectively used for compressing received audio data and decompressing audio data packets. The Audio codec may be an OPUS Audio codec or an AAC (Advanced Audio Coding) Audio codec, but the OPUS codec has lower damage to Audio data during compression compared to the AAC Audio codec, and can make the Audio data decompressed from the Audio data packet closer to the original Audio data, so the embodiment is preferably an OPUS Audio codec mode. In addition, the preset ratio for compression and decompression is set in advance according to the requirement, and the preset ratio can be nine to one, ten to one, eleven to one and the like, and the embodiment is preferably ten to one because the ten to one ratio generates better benefit in the compression and decompression process than other ratios.
Understandably, in order to ensure the integrity of the target slave computer for decompressing the audio data packet, before decompressing according to the preset mode and the preset proportion, whether the target slave computer completes the reception of the audio data packet is judged, and if the target slave computer completes the reception, the target slave computer performs decompression. Specifically, when decompressing the received audio data packet, the OPUS audio codec calls the preset ratio to decompress the audio data packet by the preset ratio, and generates audio data that can be played.
Step S30, the target slave machine plays the audio data;
furthermore, the target slave machine is provided with a built-in power amplifier module for playing audio data. In addition, the target slave is also provided with a control switch module, specifically, the control switch module comprises a button switch, when the button switch is pressed, the playing of the audio data is paused, and when the button switch is pressed in the paused state, the playing of the audio data is resumed, so as to realize the control of the playing state of the audio data.
Furthermore, in order to realize better audio playing, the target slave computer is also provided with an audio processor module so as to process the audio data decompressed by the audio codec through input gain control, input equalization adjustment, input end delay adjustment, input polarity conversion and the like, so as to obtain higher playing tone quality, and a user has better listening experience.
In this embodiment, after one or more slaves individually scan the broadcast signal transmitted by the BLE master, the slave scanned with the broadcast signal is determined as a target slave, and the target slave is connected to the BLE master and receives the audio data packet. After the target slave is connected to the BLE host, the audio data packet is decompressed and the audio data is played in a preset mode and proportion, and therefore the purpose that the BLE host is directly connected in a scanning mode without pairing is achieved, and the playing audio data is obtained. Meanwhile, a plurality of target slave machines can be simultaneously connected with the BLE host machine to play audio data, and audio sharing is achieved. In addition, the target slave and the BLE host are in communication connection through BLE, and the power consumption of the target slave is lower than that of a TWS (two way communication) headset or a classic Bluetooth headset.
Further, referring to fig. 3, a second embodiment of the BLE-based audio sharing method according to the present invention is provided based on the first embodiment of the BLE-based audio sharing method according to the present invention, in which the step of the target slave connecting to the BLE host and receiving the audio data packet sent by the BLE host includes:
step S11, the target slave machine displays a device name corresponding to the preset mark on a display screen of the target slave machine, wherein the device name is the name of the BLE master machine;
in step S12, when the target slave receives the connection request command transmitted based on the displayed device name, the target slave establishes a connection with the BLE master and receives the audio data packet transmitted by the BLE master.
In this embodiment, when the broadcast signal is scanned, the target slave displays a device name with a preset mark on the display screen, where the device name is a name set by the BLE master, so that the user can select the device name through the display screen, and send a connection request command to connect the target slave to the BLE master. And the target slave establishes connection with the BLE host and receives the audio data packet once receiving the connection request command sent by the user selection. It should be noted that the target slave includes a left earphone and a right earphone, and the BLE master can be connected to the target slave independently, so that when the target slave receives a connection request command sent based on the displayed device name, the step of establishing the connection between the target slave and the BLE master includes:
step S121, when the target slave machine receives a connection request instruction sent based on the displayed equipment name, judging the earphone attribute in the connection request instruction;
step S122, if the earphone attribute in the connection request instruction is a left ear attribute, establishing the connection between the left earphone and the BLE host;
step S123, if the earphone attribute in the connection request instruction is a right ear attribute, establishing a connection between the right earphone and the BLE host.
Further, the target slave includes a left earphone and a right earphone, both of which are provided with earphone attributes, specifically, the left earphone attribute includes an asserted flag L of the left earphone, and the right earphone attribute includes a asserted flag R of the right earphone. When the target slave receives a connection request instruction transmitted based on the displayed device name, the earphone attribute in the connection request instruction is judged. If the earphone attribute in the connection request instruction contains the identification mark L of the left earphone, establishing the connection between the left earphone and the BLE host; and if the earphone attribute in the connection request instruction contains the identification mark R of the right earphone, establishing the connection between the right earphone and the BLE host. After the target slave machine is connected with the BLE host machine, the left earphone and the right earphone in the target slave machine respectively display an icon L and an icon R which indicate that the connection with the BLE host machine is established on the display screen.
Further, after the connection is established, the target slave machine acquires the address of the BLE host machine, and the subsequent target slave machine only receives the audio data packet sent by the BLE host machine in a broadcast signal through the address; when the BLE master reads and receives the updated audio data from the terminal equipment, the target slave automatically receives the updated audio data packet.
In this embodiment, the left and right earphones of the slave are separately connected to the BLE host, and in order to ensure that the right and left earphones have selected the correct attribute, the user may select the attribute information having the earphone identification flag, thereby realizing the same frequency of the right and left earphones; specifically, when a connection request instruction sent based on the displayed device name is received, the headset attribute in the connection request instruction of the target slave is judged, so that the BLE host can accurately connect to the left headset and the right headset. After the connection with the BLE host is established, the target slave acquires the address of the BLE host, and then only receives the audio data packet sent by the BLE host through the address, wherein the audio data packet is sent by the broadcast signal, so that the phenomenon of repeatedly scanning and receiving is avoided.
Further, referring to fig. 4, fig. 4 is a flowchart illustrating a BLE-based audio sharing method according to a third embodiment of the present invention. In this embodiment, the audio sharing method includes the steps of:
step S40, when the BLE host receives an original audio, compressing the original audio into an audio data packet based on a preset mode and a preset proportion;
in this embodiment, a receiving port is set in the BLE host, the BLE host is connected with a terminal device such as a computer and a network television through the receiving port, and is configured to read and receive original audio data in the terminal device, and after the BLE host completes receiving work of the original audio data, the BLE host compresses the received original audio data in a preset proportion by using an OPUS audio codec set in the BLE host, so as to generate an audio data packet.
Step S50, the BLE master sends the audio data packet to a plurality of slaves;
the BLE host comprises a sending antenna module, and is particularly applied to sending broadcast signals; the BLE host machine sends broadcast signals to a plurality of slave machines in channels 37, 38 and 39 specified by a Bluetooth protocol by using a sending antenna module arranged on the BLE host machine based on a preset broadcast interval, wherein the broadcast signals consist of audio data packets and BLE host machine equipment names containing FLAG marks convenient for a user to identify, so that the slave machines scan the broadcast signals in the channels at different time, receive the audio data packets and realize sharing.
In this embodiment, when the BLE host receives the original audio data, the original audio data is compressed into audio data packets at a preset ratio based on the OPUS codec; the BLE host sends the audio data packets to the plurality of slaves in the form of broadcast signals, and low-power transmission of the BLE-based audio sharing system is achieved. The BLE host sends the audio data packet to the plurality of slaves, and the plurality of slaves can be connected with the BLE host at the same time to play the audio data.
Referring to fig. 5, fig. 5 is a first embodiment and a second embodiment of a BLE-based audio sharing method according to the present invention, and a fourth embodiment of the BLE-based audio sharing method according to the present invention is proposed, in which to ensure the safety of the operation, a security verification mechanism is introduced, and the execution of the security verification mechanism includes the following:
when the display screen of the target slave machine receives a wake-up instruction for waking up the display screen, detecting an execution main body of the wake-up instruction to judge whether the execution main body is a conductor, namely a substance easy to conduct current, and if the execution main body is a conductor, carrying out next judgment; otherwise, the wake-up command is refused to be executed. Judging the awakening instruction sent by the display screen based on the target slave again after judging that the execution main body is a conductor, and if the awakening instruction is continuously executed for two times within 2 seconds or is continuously executed for more than or equal to 3 seconds, executing the awakening instruction for awakening the display screen; otherwise, the received awakening instruction is determined to be false touch operation, and the awakening instruction is refused to be executed.
And a manager information input interface for identifying a manager is arranged in the target slave machine. When a user enters a manager information entry interface of the target slave machine for the first time, the target slave machine displays information for prompting the user to perform fingerprint entry on a display screen; after receiving a first fingerprint input operation instruction of a user, displaying information for reminding the user to perform fingerprint input again on a display screen, and when receiving a second fingerprint input operation instruction of the user, identifying the user as a manager of the target slave computer. In the subsequent use process, in order to prevent the occurrence of a malicious behavior of disconnecting the target slave machine from the BLE host machine, which is executed by a non-administrator, when the target slave machine receives a disconnection instruction for disconnecting the target slave machine from the BLE host machine, which is displayed and sent on the basis of a display screen, whether a user sending the instruction is the administrator is judged, specifically, the fingerprint attribution of the user is judged, and if the fingerprint attribution of the user is the administrator, the disconnection instruction is executed to disconnect the target slave machine from the BLE host machine; otherwise, the disconnection instruction is refused to be executed.
Further, when the target slave machine receives an instruction selected and sent by a user, the time length for executing the instruction is judged, if the time length for executing the instruction is more than or equal to 8 seconds, the shutdown instruction is executed, otherwise, the instruction selected and sent by the user based on the display screen is executed.
In the embodiment, the operator is prompted to verify information by judging the awakening and other operation instructions sent by the display screen of the target slave machine, so that the operation condition of a non-manager and the generation of mistaken touch instructions are avoided, and the safe use of all the target slave machines by the manager is facilitated.
Furthermore, the present invention also provides a computer-readable storage medium for storing a control program, which is executed by a processor and implements the steps of the BLE-based audio sharing method according to all the above embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (10)
1. An audio sharing method based on Bluetooth Low Energy (BLE), wherein the audio sharing method based on BLE comprises the following steps:
when a target slave which scans a broadcast signal sent by a BLE host exists in a plurality of slaves, the target slave is connected with the BLE host and receives an audio data packet sent by the BLE host;
the target slave computer decompresses the audio data packet based on a preset mode and a preset proportion to generate audio data;
and the target slave machine plays the audio data.
2. The BLE-based audio sharing method according to claim 1, wherein when there is a target slave among the plurality of slaves that scans for a broadcast signal transmitted by a BLE master, the step of the target slave connecting to the BLE master is preceded by:
scanning a preset channel by the plurality of slave machines, and detecting whether any slave machine in the plurality of slave machines receives a broadcast signal which is sent by the BLE host machine and carries a preset mark;
if any slave machine receives the broadcast signal, the slave machine is determined to be a target slave machine which scans the broadcast signal transmitted by the BLE host machine.
3. The BLE-based audio sharing method according to claim 2, wherein the step of the target slave connecting to the BLE host and receiving the audio data packets transmitted by the BLE host comprises:
the target slave machine displays a device name corresponding to the preset mark on a display screen of the target slave machine, wherein the device name is the name of the BLE host machine;
when the target slave receives a connection request instruction sent based on the displayed equipment name, connection between the target slave and the BLE host is established, and an audio data packet sent by the BLE host is received.
4. The BLE-based audio sharing method of claim 3, wherein the target slave comprises a left earphone and a right earphone; the step of establishing connection between the target slave and the BLE master when the target slave receives a connection request command transmitted based on the displayed device name includes:
when the target slave machine receives a connection request instruction sent based on the displayed equipment name, judging the earphone attribute in the connection request instruction;
if the earphone attribute in the connection request instruction is a left ear attribute, establishing connection between the left earphone and the BLE host;
and if the earphone attribute in the connection request instruction is a right ear attribute, establishing the connection between the right earphone and the BLE host.
5. The BLE-based audio sharing method according to claim 3, wherein the step of receiving audio data packets transmitted by the BLE host comprises:
and the target slave acquires the address of the BLE host and receives the audio data packet sent by the BLE host in the broadcast signal according to the address.
6. The BLE-based audio sharing method according to any one of claims 1-5, wherein the target slave decompresses the audio data packets based on a preset manner and a preset ratio, and the step of generating audio data comprises:
the target slave machine judges whether the audio data packet is received or not;
and if the audio data packet is received, decompressing the audio data packet based on the preset mode and the preset proportion to generate audio data.
7. A BLE-based audio sharing method, wherein the BLE-based audio sharing method comprises the following steps:
when the BLE host receives original audio data, compressing the original audio data into audio data packets based on a preset mode and a preset proportion;
the BLE host sends the audio data packet to a plurality of slaves.
8. The BLE-based audio sharing method of claim 7, wherein the step of the BLE master sending the audio data packets to a plurality of slaves comprises:
and the BLE host sends the audio data packet to a plurality of slave machines based on a broadcast signal according to a preset broadcast interval.
9. A BLE-based audio sharing system, which comprises a BLE master and a plurality of slaves, and comprises a processor and a memory, wherein the memory stores a control program, and the control program is executed by the processor and realizes the steps of the BLE-based audio sharing method according to any one of claims 1 to 8.
10. A computer readable storage medium for storing a control program for execution by a processor and implementing the steps of the BLE-based audio sharing method according to any one of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911387711.8A CN111132111B (en) | 2019-12-26 | 2019-12-26 | BLE-based audio sharing method, system and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911387711.8A CN111132111B (en) | 2019-12-26 | 2019-12-26 | BLE-based audio sharing method, system and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111132111A true CN111132111A (en) | 2020-05-08 |
CN111132111B CN111132111B (en) | 2023-12-22 |
Family
ID=70505995
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911387711.8A Active CN111132111B (en) | 2019-12-26 | 2019-12-26 | BLE-based audio sharing method, system and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111132111B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112423053A (en) * | 2020-11-06 | 2021-02-26 | 歌尔科技有限公司 | Audio sharing method, system, remote controller and computer readable storage medium |
CN112689320A (en) * | 2020-12-25 | 2021-04-20 | 杭州当贝网络科技有限公司 | Power consumption optimization method and system for 2.4G wireless audio system and readable storage medium |
CN113301544A (en) * | 2021-04-09 | 2021-08-24 | 荣耀终端有限公司 | Method and equipment for voice intercommunication between audio equipment |
CN113645573A (en) * | 2021-07-22 | 2021-11-12 | 深圳市冠旭电子股份有限公司 | Earphone configuration data sharing method, earphone and storage medium |
CN115278624A (en) * | 2022-07-21 | 2022-11-01 | Oppo广东移动通信有限公司 | Information updating method and device, audio sharing method and system and electronic equipment |
WO2024055738A1 (en) * | 2022-09-16 | 2024-03-21 | Oppo广东移动通信有限公司 | Method and apparatus for audio data sharing, and electronic device and storage medium |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150334488A1 (en) * | 2014-05-14 | 2015-11-19 | Samsung Electronics Co., Ltd. | Method and apparatus for communicating audio data |
CN105101148A (en) * | 2014-05-05 | 2015-11-25 | 中兴通讯股份有限公司 | Screen and operation control sharing method, system and main sharing end |
US20170208639A1 (en) * | 2016-01-15 | 2017-07-20 | Lg Electronics Inc. | Method and apparatus for controlling a device using bluetooth technology |
CN108111953A (en) * | 2017-12-21 | 2018-06-01 | 广东小天才科技有限公司 | Audio sharing method and system based on TWS earphone and TWS earphone |
WO2018169380A1 (en) * | 2017-03-17 | 2018-09-20 | 엘지전자(주) | Method and apparatus for processing audio signal by using bluetooth technology |
CN109474969A (en) * | 2018-12-19 | 2019-03-15 | 苏芯物联技术(南京)有限公司 | Mixed communication method and system based on IEEE 802.15.4 and low-power consumption bluetooth dual stack |
CN109547946A (en) * | 2018-11-02 | 2019-03-29 | 南京中感微电子有限公司 | A kind of voice data communication method |
US10299300B1 (en) * | 2018-05-16 | 2019-05-21 | Bose Corporation | Secure systems and methods for establishing wireless audio sharing connection |
WO2019108782A1 (en) * | 2017-12-01 | 2019-06-06 | Bose Corporation | Wireless low-latency audio content sharing |
CN110149568A (en) * | 2019-05-30 | 2019-08-20 | 歌尔科技有限公司 | A kind of bluetooth headset and communication means, system, electronic equipment, computer media |
-
2019
- 2019-12-26 CN CN201911387711.8A patent/CN111132111B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105101148A (en) * | 2014-05-05 | 2015-11-25 | 中兴通讯股份有限公司 | Screen and operation control sharing method, system and main sharing end |
US20150334488A1 (en) * | 2014-05-14 | 2015-11-19 | Samsung Electronics Co., Ltd. | Method and apparatus for communicating audio data |
US20170208639A1 (en) * | 2016-01-15 | 2017-07-20 | Lg Electronics Inc. | Method and apparatus for controlling a device using bluetooth technology |
WO2018169380A1 (en) * | 2017-03-17 | 2018-09-20 | 엘지전자(주) | Method and apparatus for processing audio signal by using bluetooth technology |
WO2019108782A1 (en) * | 2017-12-01 | 2019-06-06 | Bose Corporation | Wireless low-latency audio content sharing |
CN108111953A (en) * | 2017-12-21 | 2018-06-01 | 广东小天才科技有限公司 | Audio sharing method and system based on TWS earphone and TWS earphone |
US10299300B1 (en) * | 2018-05-16 | 2019-05-21 | Bose Corporation | Secure systems and methods for establishing wireless audio sharing connection |
CN109547946A (en) * | 2018-11-02 | 2019-03-29 | 南京中感微电子有限公司 | A kind of voice data communication method |
CN109474969A (en) * | 2018-12-19 | 2019-03-15 | 苏芯物联技术(南京)有限公司 | Mixed communication method and system based on IEEE 802.15.4 and low-power consumption bluetooth dual stack |
CN110149568A (en) * | 2019-05-30 | 2019-08-20 | 歌尔科技有限公司 | A kind of bluetooth headset and communication means, system, electronic equipment, computer media |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112423053A (en) * | 2020-11-06 | 2021-02-26 | 歌尔科技有限公司 | Audio sharing method, system, remote controller and computer readable storage medium |
CN112423053B (en) * | 2020-11-06 | 2024-04-09 | 歌尔科技有限公司 | Audio sharing method, system, remote controller and computer readable storage medium |
CN112689320A (en) * | 2020-12-25 | 2021-04-20 | 杭州当贝网络科技有限公司 | Power consumption optimization method and system for 2.4G wireless audio system and readable storage medium |
CN113301544A (en) * | 2021-04-09 | 2021-08-24 | 荣耀终端有限公司 | Method and equipment for voice intercommunication between audio equipment |
CN113301544B (en) * | 2021-04-09 | 2022-05-03 | 荣耀终端有限公司 | Method and equipment for voice intercommunication between audio equipment |
WO2022213689A1 (en) * | 2021-04-09 | 2022-10-13 | 北京荣耀终端有限公司 | Method and device for voice communicaiton between audio devices |
CN113645573A (en) * | 2021-07-22 | 2021-11-12 | 深圳市冠旭电子股份有限公司 | Earphone configuration data sharing method, earphone and storage medium |
CN113645573B (en) * | 2021-07-22 | 2023-06-09 | 深圳市冠旭电子股份有限公司 | Headset configuration data sharing method, headset and storage medium |
CN115278624A (en) * | 2022-07-21 | 2022-11-01 | Oppo广东移动通信有限公司 | Information updating method and device, audio sharing method and system and electronic equipment |
WO2024055738A1 (en) * | 2022-09-16 | 2024-03-21 | Oppo广东移动通信有限公司 | Method and apparatus for audio data sharing, and electronic device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111132111B (en) | 2023-12-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111132111B (en) | BLE-based audio sharing method, system and computer readable storage medium | |
CN107911437B (en) | Screen sharing method and device, electronic equipment and storage medium | |
CN107864469B (en) | Wireless connection method and device | |
US10521183B2 (en) | Control terminal device and audio system control method that displays a source selection screen with an area image background | |
CN109450851B (en) | Device connection method, electronic device, and computer-readable medium | |
EP2995089B1 (en) | Unpaired devices | |
US10425758B2 (en) | Apparatus and method for reproducing multi-sound channel contents using DLNA in mobile terminal | |
TW201518952A (en) | Multi-screen interaction method, apparatus and system | |
CN114786139B (en) | Connection establishment method, device, apparatus, storage medium, and program product | |
CN107147929A (en) | Multiwindow method of outputting acoustic sound, television set and computer-readable recording medium | |
CN111199743A (en) | Audio coding format determining method and device, storage medium and electronic equipment | |
WO2023284454A1 (en) | Bluetooth connection prompting method and apparatus, device, storage medium, and program product | |
CN103324459A (en) | Method and system for implementing USB (universal serial bus) headset devices | |
EP2995086B1 (en) | Paired devices | |
US20170118586A1 (en) | Voice data transmission processing method, terminal and computer storage medium | |
CN107948904B (en) | Sound box aging test method and device and computer readable storage medium | |
CN111552453B (en) | Sound effect scene control method, terminal and storage medium | |
JP7173956B2 (en) | COMMUNICATION METHOD, COMMUNICATION DEVICE, ELECTRONIC DEVICE, AND COMPUTER-READABLE STORAGE MEDIUM | |
KR101766248B1 (en) | Display system, display device and control method thereof | |
WO2014180233A1 (en) | Method and device for realizing resource sharing and terminal | |
CN105472474A (en) | Game control method and device for connection of smart television and terminal | |
CN106371800A (en) | Audio output method and device | |
WO2023020617A1 (en) | Bluetooth-based device connection method and apparatus, electronic device, and storage medium | |
CN115915081A (en) | Audio output channel switching control method, intelligent terminal and storage medium | |
US11477591B2 (en) | Audio data processing method, terminal device, 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 |