Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of an audio transmission method provided in an embodiment of the present invention, and is applied to a terminal device, where the terminal device establishes a wireless communication connection with a master earphone, as shown in fig. 1, the method includes the following steps:
step 101, obtaining audio data, and separating the audio data into first channel audio data and second channel audio data.
In this embodiment of the present invention, the main earphone may be a main earphone in a dual wireless earphone, for example: the primary earphone in the TWS headset may also be an earphone connected with the terminal device to serve as the primary earphone in two independent wireless headsets, for example: and two Bluetooth headsets, wherein one Bluetooth headset is connected with the terminal equipment and serves as a master headset, and the other Bluetooth headset is connected with the master headset and serves as a slave headset.
The audio data may be multi-channel audio data including at least two channels, for example: binaural audio data including left and right channels, or dolby stereo audio data including front left, front right, and rear surround channels, or the like.
If the audio data is two-channel stereo audio data, the first channel audio data may be audio data of one channel of left channel audio data and right channel audio data, and the second channel audio data may be audio data of the other channel of left channel audio data and right channel audio data; if the audio data is audio data of at least three channels, the first channel audio data may be audio data of a first channel of the audio data of at least three channels, and the second channel audio data may be audio data of a second channel of the audio data of at least three channels.
In this embodiment, the acquiring of the audio data may be acquiring audio data currently played or to be played by the terminal device, for example: when the terminal device plays music through the music player, audio data of the music currently played by the terminal device may be acquired, or when the terminal device opens the music player and is located in a music interface to be played, audio data of the music displayed on the music interface to be played may be acquired.
The separating of the audio data into the first channel audio data and the second channel audio data may be performed by decoding the obtained audio data, then determining the audio data belonging to the first channel and the audio data belonging to the second channel in the audio data by identifying an identifier in the decoded audio data, or according to information such as frequency, intensity, and phase difference of signals in the decoded audio data, and then extracting the audio data of the first channel and the audio data of the second channel from the determined audio data, thereby separating the audio data into the first channel audio data and the second channel audio data.
And 102, respectively packaging the first channel audio data and the second channel audio data to obtain a first channel audio data packet and a second channel audio data packet.
The above separately packing the first channel audio data and the second channel audio data may be adding information such as an address, a dock, or an identifier to the first channel audio data and the second channel audio data, and then separately packing the first channel audio data and the second channel audio data to which the information is added, thereby making a first channel audio data packet and a second channel audio data packet.
It should be noted that, because the terminal device generally has a limit on the size of the transmitted audio data when transmitting audio data with the main earphone, if the size of the separated first channel audio data and the second channel audio data exceeds the maximum data size that can be received by the main earphone, the first channel audio data and the second channel audio data need to be sequentially grouped to respectively divide the first channel audio data and the second channel audio data into a plurality of groups of audio data, and then each group of audio data needs to be respectively packed, so as to obtain a plurality of groups of first channel audio data packets and a plurality of groups of second channel audio data packets. Or, when the audio data is obtained, if the audio data played by the terminal device is large, only the audio data with a fixed size is obtained each time, so as to ensure that the size of the separated first channel audio data and the second channel audio data does not exceed the maximum data size that can be received by the main earphone, for example: if the duration of the music played by the terminal device is 1 minute, audio data with the duration of 10 seconds can be acquired each time.
Step 103, sequentially sending the first channel audio data packet and the second channel audio data packet to the master earphone, so that the master earphone plays target channel audio data, and sending channel audio data other than the target channel audio data to the slave earphone, wherein the target channel audio data is the first channel audio data or the second channel audio data.
After the first channel audio data and the second channel audio data are respectively packed, the first channel audio data packet and the second channel audio data packet can be sequentially sent to the main earphone, such that after the master earphone receives the first channel audio data packet and the second channel audio data packet, selecting the audio data packet which is in conformity with the self audio channel in the first audio channel audio data packet and the second audio channel audio data packet for decoding, and converting the audio data packet into an acoustic wave signal for playing, meanwhile, the audio data packets which are not matched with the own sound channel in the first sound channel audio data packet and the second sound channel audio data packet can be sent to the slave earphone which establishes wireless communication connection with the slave earphone, and then the slave earphone decodes the received audio data packets and converts the audio data packets into sound wave signals for playing. In this way, the master earphone and the slave earphone respectively play the first channel audio data and the second channel audio data, thereby obtaining a relatively real stereo audio playing effect.
For example: if the sound channel configured by the master earphone is the first sound channel and the sound channel configured by the slave earphone is the second sound channel, after receiving the first sound channel audio data packet and the second sound channel audio data packet, the master earphone decodes the first sound channel audio data packet, converts the first sound channel audio data packet into a sound wave signal for playing, sends the second sound channel audio data packet to the slave earphone, and decodes the second sound channel audio data packet by the slave earphone, converts the second sound channel audio data packet into a sound wave signal for playing.
Specifically, the sending of the first channel audio data packet and the second channel audio data packet to the main earphone in sequence may be that the terminal device sends the first channel audio data packet and the second channel audio data packet to the main earphone in sequence according to a sending rule agreed with the main earphone. In this way, the master earphone will receive the first channel audio data packet and the second channel audio data packet sent by the terminal device in sequence, and can determine whether to decode the first received audio data packet or send the first received audio data packet to the slave earphone according to the agreed sending rule and the configured channel information.
For example: the sound channel configured by the master earphone is a first sound channel, if the agreed sending rule is that a first sound channel audio data packet is sent first and then a second sound channel audio data packet is sent, the master earphone decodes the first sound channel audio data packet received first, and sends the second sound channel audio data packet received later to the slave earphone; if the agreed sending rule is that a second channel audio data packet is sent first and then a first channel audio data packet is sent, the master earphone sends the first received second channel audio data packet to the slave earphone, and the first channel audio data packet received later is decoded.
In this embodiment of the present invention, the terminal device may be any device having a storage medium, for example: terminal devices such as computers (Computer), Mobile phones, Tablet Personal computers (Tablet Personal Computer), Laptop computers (Laptop Computer), Personal Digital Assistants (PDA), Mobile Internet Devices (MID), and Wearable devices (Wearable Device).
In the audio transmission method in this embodiment, when the terminal device establishes a wireless communication connection with the master earphone and prepares to transmit audio data, the terminal device obtains first channel audio data and second channel audio data by separating the audio data to be transmitted, and obtains a first channel audio data packet and a second channel audio data packet by respectively packing the first channel audio data and the second channel audio data, and finally sequentially sends the first channel audio data packet and the second channel audio data packet to the master earphone, so that the master earphone plays target channel audio data, and sends channel audio data other than the target channel audio data to the slave earphone. Therefore, the audio data packet sent to the main earphone by the terminal equipment is the separated single-channel audio data packet, so that the main earphone does not need to perform separation work after receiving the audio data packet, and the purpose of reducing the power consumption of the main earphone can be achieved.
Referring to fig. 2, fig. 2 is a flowchart of another audio transmission method provided in an embodiment of the present invention, which is applied to a terminal device, where the terminal device establishes a wireless communication connection with a main headset, and in this embodiment, on the basis of the embodiment shown in fig. 1, a step of sequentially grouping first channel audio data and second channel audio data is added, and how to respectively pack the first channel audio data and the second channel audio data, and how to sequentially send the first channel audio data packet and the second channel audio data packet to the main headset are further defined, so that a rule of how to send the grouped audio data packets to the main headset is defined, so that the main headset can distinguish audio data packets of different channels according to a received sequence. As shown in fig. 2, the method comprises the steps of:
step 201, obtaining audio data, and separating the audio data into first channel audio data and second channel audio data.
The specific implementation of this step may refer to the implementation of step 101 in the method embodiment shown in fig. 1, and is not described here again to avoid repetition.
Step 202, sequentially grouping the first channel audio data and the second channel audio data to obtain N groups of first channel audio data and N groups of second channel audio data, where N is an integer greater than or equal to 1.
In this embodiment, the first channel audio data and the second channel audio data may be respectively and sequentially grouped, so as to ensure that the size of each group of audio data does not exceed the maximum data size that can be received by the main earphone at one time, and N groups of the first channel audio data and N groups of the second channel audio data after grouping are numbered sequentially. Specifically, the first channel audio data may be divided into N groups of first channel audio data with the same size, and the second channel audio data may be divided into N groups of second channel audio data with the same size, or the first channel audio data may be divided into N groups of first channel audio data with the same audio duration, and the second channel audio data may be divided into N groups of second channel audio data with the same audio duration; the first channel audio data may also be grouped in sequence according to the size of the maximum audio data packet allowed to be transmitted, so that the size of the first channel audio data packets in the first N-1 groups is the size of the maximum audio data packet, and the size of the first channel audio data packets in the last group does not exceed the size of the maximum audio data packet, wherein the grouping mode of the second channel audio data packets is the same as the grouping mode of the first channel audio data packets.
For example: the size of the first channel audio data is 5M, the audio duration is 5 minutes, and the size of the maximum audio data allowed to be transmitted is 1.1M, so that the first channel audio data can be divided into 5 groups of first channel audio data with the sizes of 1M; or the first channel audio data can be divided into 5 groups of first channel audio data with audio time lengths of 1 minute, wherein the sizes of the 5 groups of first channel audio data with audio time lengths of 1 minute do not exceed 1.1M; or the first channel audio data may be divided into 4 groups of first channel audio data each having a size of 1.1M and 1 group of first channel audio data having a size of 0.6M.
Optionally, before step 203, the method further includes:
and respectively converting the formats of the first channel audio data and the second channel audio data into target formats, wherein the target formats are formats with the best audio quality in at least two audio formats supported by the terminal equipment and the main earphone.
In this embodiment, if the terminal device and the main earphone both support at least two audio formats, before the N sets of first channel audio data and the N sets of second channel audio data are packaged, format conversion may be performed on the N sets of first channel audio data and the N sets of second channel audio data, respectively, so as to convert the N sets of first channel audio data and the N sets of second channel audio data into a format with the best audio quality in the at least two audio formats, so as to ensure that the audio played by the main earphone has better sound quality. Specifically, the format conversion may be performed by decoding the N groups of first channel audio data and the N groups of second channel audio data, and then encoding the decoded N groups of first channel audio data and N groups of second channel audio data into the audio data in the target format.
For example: if the terminal device and the main earphone not only support a sub-band Coding (SBC) Audio format but also support an Advanced Audio Coding (ACC) Audio format, the ACC Audio format can be used as the target format to ensure that the Audio played by the main earphone has better tone quality because the tone quality of the Audio in the ACC Audio format is better than that of the Audio in the SBC Audio format; if the terminal device and the main earphone also support an Apt-X audio format, the Apt-X audio format is a lossless audio format, and the tone quality of the audio in the Apt-X audio format is better than that of the audio in an ACC audio format, so that the Apt-X audio format can be used as the target format to ensure that the audio played by the main earphone has better tone quality.
Of course, the same can be applied to the embodiment shown in fig. 1 and the same advantageous effects can be achieved.
Step 203, respectively packaging the N groups of first channel audio data to obtain N groups of first channel audio data packets, and respectively packaging the N groups of second channel audio data to obtain N groups of second channel audio data packets.
After the first channel audio data and the second channel audio data are respectively and sequentially grouped, the N groups of first channel audio data may be respectively packed to obtain N groups of first channel audio data packets, and the N groups of second channel audio data may be respectively packed to obtain N groups of second channel audio data packets.
Optionally, after step 203 and before step 204, the method further includes:
and adding a first channel identifier to the first channel audio data packet, and adding a second channel identifier to the second channel audio data packet.
In this embodiment, after the first channel audio data are sequentially grouped and packed, a first channel identifier may be added to each group of first channel audio data packets, and a second channel identifier may be added to each group of second channel audio data packets, where the first channel identifier and the second channel identifier may both adopt simple numbers, letters, or symbols, for example: the number 1 (corresponding to binary "01") is used as the first channel identifier, and the number 2 (corresponding to binary "10") is used as the second channel identifier, so that the first channel identifier "01" can be added to each group of first channel audio packets, and the second channel identifier "10" can be added to each group of second channel audio packets.
Specifically, the terminal device may agree with the master earphone by a protocol to obtain a first channel identifier and a second channel identifier, and thus, the terminal device may add corresponding channel identifiers to each group of first channel audio data packets and each group of second channel audio data packets according to the agreed channel identifiers, and the master earphone may check each group of received first channel audio data packets and each group of second channel audio data packets according to the agreed channel identifiers, so as to decode the audio data packets whose channel identifiers match the channel identifiers corresponding to the master earphone, convert the audio data packets into sound wave signals to be played, and send the audio data packets whose channel identifiers do not match the channel identifiers corresponding to the slave earphone to be played through the slave earphone.
In this way, in this embodiment, by adding the first channel identifier to the first channel audio data packet and adding the second channel identifier to the second channel audio data packet, it can be ensured that the slave earphone can conveniently and accurately determine the audio data packet conforming to its own channel through the channel identifier added to each group of audio data packets, and determine the audio data packet to be sent to the slave earphone, and it can avoid the problem that the audio playing effect is poor due to the fact that the master earphone cannot accurately distinguish the first channel audio data packet from the second channel audio data packet when the terminal device loses packets in the sending process.
Of course, the same can be applied to the embodiment shown in fig. 1 and the same advantageous effects can be achieved.
And 204, sequentially and alternately sending the N groups of first channel audio data packets and the N groups of second channel audio data packets to the main earphone.
In this embodiment, when sending the audio data packet to the main earphone, a 1 st group of first channel audio data packets and a 1 st group of second channel audio data packets may be sent to the main earphone in sequence, and then a 2 nd group of first channel audio data packets and a 2 nd group of second channel audio data packets may be sent to the main earphone until the N th group of first channel audio data packets and the N nd group of second channel audio data packets are sent to the main earphone.
Specifically, the terminal device may pre-define a sending rule, that is, may pre-define whether to send the first channel audio data packet to the main earphone first or send the second channel audio data packet first, so that the terminal device may send the N groups of first channel audio data packets and the N groups of second channel audio data packets to the main earphone alternately in sequence according to the pre-defined sending rule. For example: the method may further include sending a 1 st group of first channel audio data packets to the main earphone, sending a 1 st group of second channel audio data packets to the main earphone, sending a 2 nd group of first channel audio data packets to the main earphone, and sending a 2 nd group of second channel audio data packets to the main earphone, so that the N groups of first channel audio data packets and the N groups of second channel audio data packets are all sent to the main earphone in sequence and alternately.
The main earphone may receive the 1 st group of first channel audio data packets and the 1 st group of second channel audio data packets sent by the terminal device, and then receive the 2 nd group of first channel audio data packets and the 2 nd group of second channel audio data packets sent by the terminal device, until receiving the N th group of first channel audio data packets and the N th group of second channel audio data packets sent by the terminal device.
Specifically, since the terminal device may sequentially and alternately send the N groups of first channel audio data packets and the N groups of second channel audio data packets to the master earphone according to a predefined sending rule, the master earphone may also sequentially and alternately receive the N groups of first channel audio data packets and the N groups of second channel audio data packets, so that the master earphone may determine, according to the receiving order, a channel corresponding to each group of received audio data packets, so as to decode only an audio data packet whose channel matches itself and convert the audio data packet into an acoustic wave signal for playing, and send an audio data packet whose channel does not match itself to the slave earphone, so as to play audio data of another channel through the slave earphone.
For example: if the sound channel configured by the master earphone is a first sound channel and the sound channel configured by the slave earphone is a second sound channel, the master earphone sequentially receives a 1 st group of first sound channel audio data packets, a 1 st group of second sound channel audio data packets, a 2 nd group of first sound channel audio data packets, a 2 nd group of second sound channel audio data packets … …, an nth group of first sound channel audio data packets and an nth group of second sound channel audio data packets sent by the terminal device, and when 2N groups of audio data packets are total, the master earphone can decode and convert the received 1 st group, 3 rd group, 5 th group … … 2N-3 group and 2N-1 group audio data packets into sound wave signals respectively according to the receiving sequence, so as to play the audio data of the first sound channel through the master earphone, and simultaneously send the received 2 nd group, 4 th group, 6 th group … … nd 2N-2 group and 2N group audio data packets to the slave earphone, by playing the audio data of the second channel from the headphones.
It should be noted that, in this embodiment, the execution timing of step 202, step 203, and step 204 is not limited, that is, the terminal device may package a group of first channel audio data and a group of second channel audio data after completing a group of first channel audio data and a group of second channel audio data, and sequentially send the packaged group of first channel audio data and group of second channel audio data to the main earpiece, and then enter the next grouping, packaging, and sending process until the audio transmission is completed; or after all the packets are grouped, respectively packing the obtained N groups of first channel audio data and N groups of second channel audio data, and then sequentially and alternately sending the N groups of first channel audio data packets and the N groups of second channel audio data packets to the main earphone.
In this way, in this step, by sequentially and alternately sending the N groups of first channel audio data packets and the N groups of second channel audio data packets to the master earphone, it can be ensured that the master earphone can distinguish the first channel audio data packets and the second channel audio data packets according to the receiving sequence, and the problem of audio asynchrony or delay occurring when the master earphone and the slave earphone play the audio data of their respective channels can be avoided.
In this embodiment, on the basis of the embodiment shown in fig. 1, a step of sequentially grouping the first channel audio data and the second channel audio data, respectively, is added, and further limitation is performed on how to pack the first channel audio data and the second channel audio data, and how to sequentially send the first channel audio data packet and the second channel audio data packet to the main earphone, so that a rule of how to send the grouped audio data packets to the main earphone is defined, so that the main earphone can distinguish audio data packets of different channels according to a receiving sequence. In addition, in this embodiment, various optional embodiments are added on the basis of the embodiment shown in fig. 1, and these optional embodiments may be implemented in combination with each other or separately, and all the technical effects of reducing the power consumption of the main earphone can be achieved.
Referring to fig. 3, fig. 3 is a flowchart of another audio transmission method provided in an embodiment of the present invention, which is applied to a master earphone, where the master earphone establishes a wireless communication connection with a terminal device, and the master earphone further establishes a wireless communication connection with a slave earphone, as shown in fig. 3, the method includes the following steps:
step 301, receiving a first channel audio data packet and a second channel audio data packet sequentially sent by the terminal device.
Step 302, sending the first channel audio data packet or the second channel audio data packet to the slave earphone.
It should be noted that, this embodiment is used as an implementation of the main earphone corresponding to the embodiment shown in fig. 1, and specific implementation of the embodiment may refer to relevant descriptions in the embodiment shown in fig. 1, and in order to avoid repeated descriptions, the embodiment is not described again.
In the audio transmission method in this embodiment, when the master earphone establishes wireless communication connection with the terminal device and transmits audio data, the master earphone receives the separated monaural audio data packet transmitted by the terminal device, and thus the master earphone does not need to separate the received audio data packet, and the power consumption of the master earphone can be reduced.
Referring to fig. 4, fig. 4 is a flowchart of another audio transmission method provided in an embodiment of the present invention, which is applied to a master earphone, where the master earphone establishes a wireless communication connection with a terminal device, and the master earphone also establishes a wireless communication connection with a slave earphone, and in this embodiment, on the basis of the embodiment shown in fig. 3, steps of receiving a first channel audio data packet and a second channel audio data packet sequentially sent by the terminal device are refined, so as to define an order of receiving the audio data packets sent by the terminal device, so that the master earphone can distinguish the audio data packets of different channels according to the received order, and the phenomenon that the audio played by the master earphone and the audio played by the slave earphone are not synchronized can be avoided. As shown in fig. 4, the method comprises the steps of:
step 401, receiving N groups of first channel audio data packets and N groups of second channel audio data packets, where N is an integer greater than or equal to 1, which are alternately sent by the terminal device in sequence.
Step 402, sending the N groups of first channel audio data packets or the N groups of second channel audio data packets to the slave earphone.
It should be noted that, this embodiment is used as an implementation manner of the main earphone corresponding to the embodiment shown in fig. 2, and specific implementation manners thereof may refer to relevant descriptions in the embodiment shown in fig. 2, and in order to avoid repeated descriptions, the detailed description of this embodiment is not repeated.
It should be noted that, in this embodiment, it is not limited that the master earphone must perform step 402 after receiving all N sets of first channel audio data packets and N sets of second channel audio data packets, that is, after receiving one set of first channel audio data packets and one set of second channel audio data packets, the master earphone may send one set of audio data packets, which is not matched with its own channel, of the two sets of received audio data packets to the slave earphone.
In this embodiment, on the basis of the embodiment shown in fig. 3, the step of receiving the first channel audio data packet and the second channel audio data packet sent by the terminal device is detailed, so that the order of receiving the audio data packets sent by the terminal device is defined, the master earphone can distinguish the audio data packets of different channels according to the receiving order, and the phenomenon that the audio played by the master earphone and the slave earphone is not synchronized can be avoided. In addition, in this embodiment, various optional embodiments are added on the basis of the embodiment shown in fig. 3, and these optional embodiments may be implemented in combination with each other or separately, and all the technical effects of reducing the power consumption of the main earphone can be achieved.
The embodiments described in the above examples are described below by way of example with reference to fig. 5, 6 and 7:
as shown in fig. 5, an audio transmission System includes a terminal device, a master earphone and a slave earphone, where the terminal device includes a bluetooth module, a Micro Control Unit (MCU) and a CODEC (CODEC), the master earphone includes a bluetooth module, a System on a Chip (SOC), a CODEC and a speaker module, the slave earphone includes a bluetooth module, a CODEC and a speaker module, the terminal device and the master earphone establish a wireless communication connection through their respective bluetooth modules, and the master earphone and the slave earphone establish a wireless communication connection through their respective bluetooth modules.
As shown in fig. 6, the terminal device first obtains audio data, and performs channel separation on the audio data through the MCU to obtain left channel audio data and right channel audio data; the left channel audio data and the right channel audio data are then encoded by the CODEC to convert the formats of the left channel audio data and the right channel audio data into formats supported by the master earphone and the slave earphone, respectively, such as: an SBC format, an ACC format, or an Apt-X format; then, the encoded left channel audio data and the encoded right channel audio data are sequentially grouped and packed to obtain a plurality of groups of left channel audio data packets and a plurality of groups of right channel audio data packets, and a channel identifier can be added to each group of audio data packets to identify the channel information of each group of audio data packets; and finally, sending a plurality of groups of left channel audio data packets and a plurality of groups of right channel audio data packets to the master earphone in sequence, specifically, sending a group of right channel audio data packets after sending a group of left channel audio data packets, then sending the next group of left channel audio data packets and right channel audio data packets in sequence, and sending the packets in sequence alternately until all packets are sent, so that the problem that the left channel audio and the right channel audio are not synchronous or delay is large when the master earphone and the slave earphone play the audio can be avoided.
As shown in fig. 7, the master earphone receives a plurality of groups of left channel audio data packets and a plurality of groups of right channel audio data packets sent by the terminal device, specifically, each time a group of audio data packets is received, and when each group of audio data packets is received, the SOC checks the channel identifier of the group of audio data packets, if the channel identified by the channel identifier of the group of audio data packets matches the channel of the slave earphone, the group of audio data packets is decoded by the CODEC and played by the speaker module, if the channel identified by the channel identifier of the group of audio data packets does not match the channel of the slave earphone, the group of audio data packets is sent to the slave earphone, and after the slave earphone receives the group of audio data packets, the group of audio data packets is decoded by the CODEC and played by the speaker module.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present invention, where the terminal device establishes a wireless communication connection with a main headset, and as shown in fig. 8, the terminal device 800 includes:
a separation module 801, configured to acquire audio data and separate the audio data into first channel audio data and second channel audio data;
a packing module 802, configured to separately pack the first channel audio data and the second channel audio data to obtain a first channel audio data packet and a second channel audio data packet;
a sending module 803, configured to send the first channel audio data packet and the second channel audio data packet to the master earphone in sequence, so that the master earphone plays target channel audio data, and sends channel audio data other than the target channel audio data to a slave earphone, where the target channel audio data is the first channel audio data or the second channel audio data.
Optionally, as shown in fig. 9, the terminal device 800 further includes:
a grouping module 804, configured to sequentially group the first channel audio data and the second channel audio data to obtain N groups of first channel audio data and N groups of second channel audio data, where N is an integer greater than or equal to 1;
the packing module 802 is configured to pack the N groups of first channel audio data to obtain N groups of first channel audio data packets, and pack the N groups of second channel audio data to obtain N groups of second channel audio data packets;
the sending module 803 is configured to sequentially and alternately send the N groups of first channel audio data packets and the N groups of second channel audio data packets to the master earphone.
Optionally, as shown in fig. 10, the terminal device 800 further includes:
an adding module 805, configured to add a first channel identifier to the first channel audio data packet, and add a second channel identifier to the second channel audio data packet.
Optionally, as shown in fig. 11, the terminal device 800 further includes:
a converting module 806, configured to convert formats of the first channel audio data and the second channel audio data into target formats, respectively, where the target formats are formats with the best audio quality among at least two audio formats supported by both the terminal device and the main headset.
The terminal device 800 can implement each process implemented by the terminal device in the method embodiments of fig. 1 and fig. 2, and is not described here again to avoid repetition. When the terminal device 400 of the embodiment of the present invention establishes a wireless communication connection with a master earphone and prepares to transmit audio data, the terminal device obtains a first channel audio data and a second channel audio data by separating the audio data to be transmitted, and obtains a first channel audio data packet and a second channel audio data packet by respectively packaging the first channel audio data and the second channel audio data, and finally sequentially sends the first channel audio data packet and the second channel audio data packet to the master earphone, so that the master earphone plays target channel audio data, and sends channel audio data other than the target channel audio data to a slave earphone. Therefore, the audio data packet sent to the main earphone by the terminal equipment is the separated single-channel audio data packet, so that the main earphone does not need to perform separation work after receiving the audio data packet, and the purpose of reducing the power consumption of the main earphone can be achieved.
Referring to fig. 12, fig. 12 is a schematic structural diagram of a master earphone according to an embodiment of the present invention, where the master earphone establishes a wireless communication connection with a terminal device, and the master earphone further establishes a wireless communication connection with a slave earphone, as shown in fig. 12, the master earphone 1200 includes:
a receiving module 1201, configured to receive a first channel audio data packet and a second channel audio data packet that are sequentially sent by the terminal device;
a sending module 1202, configured to send the first channel audio data packet or the second channel audio data packet to the slave headset.
Optionally, the receiving module 1201 is configured to receive N groups of first channel audio data packets and N groups of second channel audio data packets that are alternately sent by the terminal device in sequence, where N is an integer greater than or equal to 1.
Optionally, a first channel identifier is added to the first channel audio data packet, and a second channel identifier is added to the second channel audio data packet;
the sending module 1202 is configured to send, to the slave earphone, an audio data packet whose channel identifier is not in accordance with the channel identifier corresponding to the master earphone in the first channel audio data packet and the second channel audio data packet.
The main earphone 1200 can implement each process implemented by the main earphone in the method embodiments of fig. 3 and fig. 4, and is not described here again to avoid repetition. When the main earphone of the embodiment of the invention establishes wireless communication connection with the terminal equipment and transmits audio data, the main earphone receives the separated single-channel audio data packet sent by the terminal equipment, so that the main earphone does not need to separate the received audio data packet, and the purpose of reducing the power consumption of the main earphone can be further achieved.
Fig. 13 is a schematic diagram of a hardware structure of a terminal device for implementing various embodiments of the present invention, where the terminal device establishes a wireless communication connection with a master earphone, and the terminal device 1300 includes, but is not limited to: a radio frequency unit 1301, a network module 1302, an audio output unit 1303, an input unit 1304, a sensor 1305, a display unit 1306, a user input unit 1307, an interface unit 1308, a memory 1309, a processor 1310, a power supply 1311, and the like. Those skilled in the art will appreciate that the terminal device configuration shown in fig. 13 does not constitute a limitation of the terminal device, and that the terminal device may include more or fewer components than shown, or combine certain components, or a different arrangement of components. In the embodiment of the present invention, the terminal device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
Wherein the processor 1310 is configured to obtain audio data and separate the audio data into first channel audio data and second channel audio data;
respectively packaging the first channel audio data and the second channel audio data to obtain a first channel audio data packet and a second channel audio data packet;
a radio frequency unit 1301, configured to send the first channel audio data packet and the second channel audio data packet to the master earphone in sequence, so that the master earphone plays target channel audio data, and sends channel audio data other than the target channel audio data to a slave earphone, where the target channel audio data is the first channel audio data or the second channel audio data;
optionally, the processor 1310 is further configured to: sequentially grouping the first channel audio data and the second channel audio data respectively to obtain N groups of first channel audio data and N groups of second channel audio data, wherein N is an integer greater than or equal to 1;
respectively packaging the N groups of first channel audio data to obtain N groups of first channel audio data packets, and respectively packaging the N groups of second channel audio data to obtain N groups of second channel audio data packets;
the radio frequency unit 1301 is further configured to: and sequentially and alternately sending the N groups of first channel audio data packets and the N groups of second channel audio data packets to the main earphone.
Optionally, the processor 1310 is further configured to: and adding a first channel identification to the first channel audio data packet, and adding a second channel identification to the second channel audio data packet.
Optionally, the processor 1310 is further configured to: and respectively converting the formats of the first channel audio data and the second channel audio data into target formats, wherein the target formats are formats with the best audio quality in at least two audio formats supported by the terminal equipment and the main earphone.
The terminal device 1300 can implement each process implemented by the terminal device in the foregoing embodiments, and details are not described here to avoid repetition. When the terminal device 1300 of the embodiment of the present invention establishes a wireless communication connection with a master earphone and prepares to transmit audio data, the terminal device obtains a first channel audio data and a second channel audio data by separating the audio data to be transmitted, and obtains a first channel audio data packet and a second channel audio data packet by respectively packaging the first channel audio data and the second channel audio data, and finally sends the first channel audio data packet and the second channel audio data packet to the master earphone, so that the master earphone plays target channel audio data, and sends channel audio data other than the target channel audio data to a slave earphone. Therefore, the audio data packet sent to the main earphone by the terminal equipment is the separated single-channel audio data packet, so that the main earphone does not need to perform separation work after receiving the audio data packet, and the purpose of reducing the power consumption of the main earphone can be achieved.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 1301 may be configured to receive and transmit signals during a message transmission or call process, and specifically, receive downlink data from a base station and then process the received downlink data to the processor 1310; in addition, the uplink data is transmitted to the base station. In general, radio unit 1301 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 1301 can also communicate with a network and other devices through a wireless communication system.
The terminal device provides wireless broadband internet access to the user through the network module 1302, such as helping the user send and receive e-mails, browse web pages, and access streaming media.
The audio output unit 1303 can convert audio data received by the radio frequency unit 1301 or the network module 1302 or stored in the memory 1309 into an audio signal and output as sound. Also, the audio output unit 1303 can also provide audio output related to a specific function performed by the terminal apparatus 1300 (e.g., a call signal reception sound, a message reception sound, and the like). The audio output unit 1303 includes a speaker, a buzzer, a receiver, and the like.
The input unit 1304 is used to receive audio or video signals. The input Unit 1304 may include a Graphics Processing Unit (GPU) 13041 and a microphone 13042, and the Graphics processor 13041 processes image data of still pictures or video obtained by an image capturing apparatus (such as a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 1306. The image frames processed by the graphic processor 13041 may be stored in the memory 1309 (or other storage medium) or transmitted via the radio frequency unit 1301 or the network module 1302. The microphone 13042 can receive sounds and can process such sounds into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 1301 in case of a phone call mode.
The terminal device 1300 also includes at least one sensor 1305, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that adjusts the brightness of the display panel 13061 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 13061 and/or backlight when the terminal device 1300 moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the terminal device posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration identification related functions (such as pedometer, tapping), and the like; the sensors 1305 may also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be described in detail herein.
The display unit 1306 is used to display information input by a user or information provided to the user. The Display unit 1306 may include a Display panel 13061, and the Display panel 13061 may be configured as a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 1307 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the terminal device. Specifically, the user input unit 1307 includes a touch panel 13071 and other input devices 13072. Touch panel 13071, also referred to as a touch screen, can collect touch operations by a user on or near it (such as user operations on touch panel 13071 or near touch panel 13071 using a finger, stylus, or any other suitable object or attachment). The touch panel 13071 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 1310, and receives and executes commands sent from the processor 1310. In addition, the touch panel 13071 can be implemented by various types such as resistive, capacitive, infrared, and surface acoustic wave. The user input unit 1307 may include other input devices 13072 in addition to the touch panel 13071. In particular, the other input devices 13072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described herein again.
Further, the touch panel 13071 can be overlaid on the display panel 13061, and when the touch panel 13071 detects a touch operation thereon or nearby, the touch operation can be transmitted to the processor 1310 to determine the type of touch event, and then the processor 1310 can provide a corresponding visual output on the display panel 13061 according to the type of touch event. Although in fig. 13, the touch panel 13071 and the display panel 13061 are two independent components to implement the input and output functions of the terminal device, in some embodiments, the touch panel 13071 and the display panel 13061 may be integrated to implement the input and output functions of the terminal device, and are not limited herein.
The interface unit 1308 is an interface for connecting an external device to the terminal apparatus 1300. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 1308 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the terminal apparatus 1300 or may be used to transmit data between the terminal apparatus 1300 and an external device.
The memory 1309 may be used to store software programs as well as various data. The memory 1309 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 1309 can include high-speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 1310 is a control center of the terminal device, connects various parts of the entire terminal device by using various interfaces and lines, and performs various functions of the terminal device and processes data by running or executing software programs and/or modules stored in the memory 1309 and calling data stored in the memory 1309, thereby performing overall monitoring of the terminal device. Processor 1310 may include one or more processing units; preferably, the processor 1310 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 1310.
The terminal device 1300 may further include a power supply 1311 (e.g., a battery) for supplying power to the various components, and preferably, the power supply 1311 may be logically connected to the processor 1310 via a power management system, so that functions of managing charging, discharging, and power consumption are performed via the power management system.
In addition, the terminal device 1300 includes some functional modules that are not shown, and are not described herein again.
Preferably, an embodiment of the present invention further provides a terminal device, which includes a processor 1310, a memory 1309, and a computer program stored in the memory 1309 and capable of running on the processor 1310, where the computer program, when executed by the processor 1310, implements each process of the method embodiments in fig. 1 and fig. 2, and can achieve the same technical effect, and is not described herein again to avoid repetition.
Referring to fig. 14, fig. 14 is a schematic structural diagram of another master earphone according to an embodiment of the present invention, where the master earphone establishes a wireless communication connection with a terminal device, and the master earphone further establishes a wireless communication connection with a slave earphone. As shown in fig. 14, the main earphone 1400 includes: a processor 1401, a memory 1402 and a computer program stored on and executable on said memory 1402, the various components in the main headset 1400 being coupled together by a bus system 1403. It is understood that bus system 1403 is used to enable connection communication between these components.
Wherein processor 1401 is configured to: receiving a first channel audio data packet and a second channel audio data packet which are sequentially sent by the terminal equipment;
transmitting the first channel audio data packet or the second channel audio data packet to the slave headset.
Optionally, the processor 1401 is further configured to: and receiving N groups of first channel audio data packets and N groups of second channel audio data packets which are sequentially and alternately sent by the terminal equipment, wherein N is an integer greater than or equal to 1.
Optionally, a first channel identifier is added to the first channel audio data packet, and a second channel identifier is added to the second channel audio data packet;
processor 1401 is further configured to: and sending the audio data packet of which the sound channel identifier is not consistent with the sound channel identifier corresponding to the master earphone in the first sound channel audio data packet and the second sound channel audio data packet to the slave earphone.
The main headset 1400 can implement each process implemented by the cloud server in the embodiments shown in fig. 3 and fig. 4, and is not described herein again to avoid repetition. When the main earphone 1400 of the embodiment of the present invention establishes wireless communication connection with the terminal device and transmits audio data, since the main earphone receives the separated monaural audio data packet transmitted by the terminal device, the main earphone does not need to separate the received audio data packet, and the power consumption of the main earphone can be reduced.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the method embodiments in fig. 1 and fig. 2, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
The embodiment of the present invention further provides another computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the method embodiments in fig. 3 and fig. 4, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer readable storage medium is, for example, ROM, RAM, magnetic disk or optical disk.
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 apparatus 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 apparatus. 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 apparatus that comprises the element.
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 solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as 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.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.