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, a flowchart illustrating steps of an audio file playing method according to a first embodiment of the present invention is shown.
The audio file playing method provided by the embodiment of the invention comprises the following steps:
step 101: the first earphone separates the audio file to be played into a right channel audio stream and a left channel audio stream, and sends the right channel audio stream to the second earphone.
The wireless answering device comprises a first earphone and a second earphone, when an audio file needs to be played, the audio file to be played sent by the mobile terminal is received, stereo separation is carried out on the audio file to be played, a left channel audio stream and a right channel audio stream are separated, the right channel audio stream is sent to the second earphone by the first earphone, the left channel audio stream is played by the first earphone, the right channel audio stream is played by the second earphone, and stereo sound effect is generated.
Step 102: and after receiving the right channel audio stream, the second earphone generates a no-load data packet carrying an audio stream playing instruction code and sends the no-load data packet to the first earphone.
The second earphone automatically encodes to generate an idle data packet, and inserts an audio stream playing instruction code into a dock of the idle data packet, for example: the audio stream playing instruction code can be set to be 'GO', and the second earphone sends the no-load data packet inserted with the audio stream playing instruction code 'GO' to the first earphone.
Step 103: and the second earphone sends the no-load data packet to the first earphone and then plays the right channel audio stream by delaying the preset time length so as to play the audio stream synchronously with the first earphone.
In order to ensure that the first earphone and the second earphone synchronously play the audio stream, after the second earphone sends the no-load data packet to the first earphone, the second earphone is required to delay the playing of the right channel audio stream for a preset time. The reason that the preset time length is delayed is that time is consumed for sending the no-load data packet to the first earphone after the no-load data packet is sent to the first earphone, and time is consumed for decoding, checking and playing the instruction code on the no-load data packet after the no-load data packet is received by the first earphone, so that the preset time length can be the sum of the time consumed in the two stages.
Step 104: and after the first earphone identifies the audio stream playing instruction code from the received idle load data packet, playing the audio stream of the left channel.
The first earphone receives the left channel audio stream, the left channel audio stream is not directly played, when the first earphone receives an idle load data packet, the idle load data packet is decoded and checked, and when an audio stream playing instruction code 'GO' is identified, the first earphone outputs the left channel mode audio stream to a loudspeaker module of the first earphone to be converted into sound waves, so that the left channel audio stream is played.
In the embodiment of the invention, after an audio file to be played is separated into a right channel audio stream and a left channel audio stream through a first earphone, the right channel audio stream is sent to a second earphone; after receiving the right channel audio stream, the second earphone generates a no-load data packet carrying an audio stream playing instruction code and sends the no-load data packet to the first earphone; the second earphone delays the preset time length to play the right sound channel audio stream; after the first earphone identifies the audio stream playing instruction code from the received no-load data packet, the left channel audio stream is played, because the no-load data packet is very small, namely the time consumed by the first earphone for receiving the no-load data packet can be ignored, which is equivalent to that after the first earphone identifies the audio stream playing instruction code, the left channel audio stream is immediately played, so that the first earphone and the second earphone almost simultaneously play, and the audio synchronous playing accuracy between the first earphone and the second earphone of the wireless earphone is improved.
Referring to fig. 2, a flowchart illustrating steps of an audio file playing method according to a second embodiment of the present invention is shown.
The embodiment of the invention is based on wireless answering equipment, the wireless receiving equipment comprises a first earphone and a second earphone, and the audio file playing method provided by the embodiment of the invention comprises the following steps:
step 201: and the first earphone receives the audio file to be played transmitted by the mobile terminal based on the Bluetooth audio transmission model protocol.
Wherein, first earphone and second earphone all contain bluetooth radio frequency module.
When a user listens to stereo music by using a music player of the mobile terminal, a mobile terminal MCU (Microcontroller Unit) controls an audio file to be played to be re-decoded, encoded and compressed by a CODEC (COder/DECoder) to form a stereo audio file in a sub-band encoding format; and the MCU controls the audio files in the sub-band coding format to be grouped and packaged. The communication of the Bluetooth radio frequency module to the Audio files is based on an A2DP (Advanced Audio Distribution Profile, Bluetooth Audio transmission model protocol) protocol, so that the Audio files in the sub-band coding format need to be grouped and packaged into an A2DP Audio data packet; the MCU controls a Bluetooth radio frequency module in the mobile terminal to transmit the A2DP audio data packet to the Bluetooth radio frequency module of the first earphone.
Step 202: the first headphone separates an audio file to be played into a right channel audio stream and a left channel audio stream.
The first earphone is a main earphone of the wireless answering device and has the function of separating an audio file into a left channel audio stream and a right channel audio stream. For a specific manner of separating the audio file to be played into the left and right channel audio streams by the first headphone, reference may be made to related technologies, which is not specifically limited in the embodiment of the present invention.
Step 203: the right channel audio stream is sent to a second headphone.
After a first earphone receives an A2DP audio data packet sent by a mobile terminal through a bluetooth radio frequency module of the first earphone, an SOC (System on Chip) of the first earphone controls a CODEC to decompress the A2DP audio data packet, and the SOC performs stereo separation work on a sub-band coding format stereo audio file after decompression to separate a left channel audio stream and a right channel audio stream. In practical use, the first earphone and the second earphone can be matched according to practical conditions by selecting to play the left channel audio stream and the right channel audio stream.
The SOC of the first earphone controls the separated left channel audio stream to be decoded by the CODEC to form a left channel analog audio signal, the left channel analog audio signal cannot be directly output to a loudspeaker submodule of the first earphone to be converted into sound waves, and the SOC of the first earphone sends the left channel audio stream to the CODEC module to be output after an audio stream playing instruction is identified from a no-load data packet sent by the second earphone.
The SOC of the first earphone recodes and compresses the right channel audio stream and packages the right channel audio stream into a right channel A2DP audio data packet, and the SOC of the first earphone controls the second earphone which transmits the right channel A2DP audio data packet to the first earphone Bluetooth radio frequency module.
Step 204: and after receiving the right channel audio stream, the second earphone generates a no-load data packet carrying an audio stream playing instruction code and sends the no-load data packet to the first earphone.
Specifically, after receiving the right channel audio stream, the second earphone encodes and packages the right channel audio stream to generate a no-load data packet; inserting an audio stream playing instruction code into the no-load data packet; and sending the no-load data packet carrying the audio stream playing instruction code to the first earphone.
After the second earphone receives the audio data packet of the right channel A2DP through the Bluetooth radio frequency module of the second earphone, the SOC control CODEC module of the second earphone decodes the audio data packet of the A2DP to form a right channel analog audio signal; and simultaneously, the SOC control CODEC module of the second earphone carries out delay output on the right channel analog audio signal.
The SOC control CODEC module of the second headphone encodes, compresses and packetizes an empty data packet, and inserts an audio stream playback command code into a dock of the empty data packet, for example: the audio stream playing instruction code of the invention is set as 'GO'; the SOC of the second earphone controls a Bluetooth radio frequency module of the second earphone to send a no-load data packet inserted with an audio stream playing instruction code 'GO' to the first earphone for receiving, so that the first earphone plays music through the audio stream playing instruction code.
Step 205: and the second earphone sends the no-load data packet to the first earphone and then plays the right channel audio stream by delaying the preset time length so as to play the audio stream synchronously with the first earphone.
Wherein, the preset duration can be: and the sum of a first time length consumed by the second earphone for sending the idle-load data packet to the first earphone and a second time length consumed by the first earphone for identifying the audio stream playing instruction code from the received idle-load data packet.
Step 206: and after the first earphone identifies the audio stream playing instruction code from the received no-load data packet, the audio stream of the right channel is sent to the loudspeaker sub-module.
The invention adopts the Bluetooth radio frequency module to transmit the no-load data packet based on the BT4.0+ EDR technology, the theoretical transmission rate of the data is 2mbps, which is equivalent to 0.5us for transmitting 1bit data, the size of the no-load data packet is usually 80 bits, the size of the no-load data packet is changed into 96 bits after the audio stream playing instruction code is inserted, and the corresponding transmission time needs 48 us.
In actual test, the idle-load data packet carrying the instruction code is subjected to multiple transmission tests between the first earphone and the second earphone, and tests under different scenes can be simulated, such as scenes with poor Bluetooth signal strength and the like.
Step 207: the speaker sub-module converts the right channel audio stream into sound waves for output.
After the first earphone receives a data packet sent by the second earphone through the Bluetooth radio frequency module of the first earphone, the SOC of the first earphone controls the CODEC module of the first earphone to decode and check the data packet, and when a command code 'GO' is identified, the SOC of the first earphone controls the CODEC module to output a left sound channel analog audio signal to convert the left sound channel analog audio signal into sound waves for the loudspeaker module of the left earphone.
In the embodiment of the invention, after an audio file to be played is separated into a right channel audio stream and a left channel audio stream through a first earphone, the right channel audio stream is sent to a second earphone; after receiving the right channel audio stream, the second earphone generates a no-load data packet carrying an audio stream playing instruction code and sends the no-load data packet to the first earphone; the second earphone delays the preset time length to play the right sound channel audio stream; after the first earphone identifies the audio stream playing instruction code from the received no-load data packet, the left channel audio stream is played, because the no-load data packet is very small, namely the time consumed by the first earphone for receiving the no-load data packet can be ignored, which is equivalent to that after the first earphone identifies the audio stream playing instruction code, the left channel audio stream is immediately played, so that the first earphone and the second earphone almost simultaneously play, and the audio synchronous playing accuracy between the first earphone and the second earphone of the wireless earphone is improved. In addition, the second earphone is delayed for a preset time, so that the first earphone and the second earphone can almost achieve the effect of synchronous playing, and listening experience is improved.
Referring to fig. 3, a block diagram of a wireless listening device according to a third embodiment of the present invention is shown.
The wireless answering equipment provided by the embodiment of the invention comprises: the wireless listening device comprises afirst earphone 301 and asecond earphone 302, thefirst earphone 301 comprises aprogrammable controller 3011, a first bluetoothradio frequency module 3012 and asecond playing module 3013, and thesecond earphone 302 comprises: a second bluetoothradio frequency module 3021, afirst playing module 3022, and a first codec 3023: after theprogrammable controller 3011 separates an audio file to be played into a right channel audio stream and a left channel audio stream, the first bluetoothradio frequency module 3012 sends the right channel audio stream to the second headset; after the second bluetoothradio frequency module 3021 of the second earphone receives the right channel audio stream, thefirst codec 3023 generates an empty load data packet carrying an audio stream playing instruction code, and the second bluetooth radio frequency module sends the empty load data packet to the first earphone; afirst playing module 3022, configured to delay playing the right channel audio stream for a preset time after sending the no-load data packet to the first earphone, so as to play the audio stream synchronously with the first earphone; thesecond playing module 3013 is configured to play the left audio stream after identifying the audio stream playing instruction code from the received idle data packet.
Preferably, the preset time period is as follows: and the second earphone sends the no-load data packet to the first earphone, and the sum of a first time length consumed by the first earphone for identifying the audio stream playing instruction code from the no-load data packet.
Preferably, as shown in fig. 5, thesecond playing module 3013 includes aspeaker sub-module 30131 and a second codec 30132: after the programmable controller of the first headphone identifies the audio stream playing instruction code from the received idle-load data packet, thesecond codec 30132 sends the right channel audio stream to the speaker sub-module; thespeaker sub-module 30131 converts the right channel audio stream into acoustic output.
Preferably, as shown in fig. 4, it is a block diagram of a first bluetooth radio frequency module, where the first bluetoothradio frequency module 3012 includes: the receivingsubmodule 30121 is configured to receive an audio file to be played, which is transmitted by the mobile terminal based on a bluetooth audio transmission model protocol; aseparating module 30122, configured to separate the audio file to be played into a right channel audio stream and a left channel audio stream.
Preferably, thesecond earphone 302 further comprises a video stream playing instructioncode inserting module 3024; after the second bluetoothradio frequency module 3021 of thesecond earphone 302 receives the right channel audio stream, thefirst codec 3023 is specifically configured to encode and package to generate an idle data packet; the video stream playing instructioncode inserting module 3024 is configured to insert an audio stream playing instruction code into the no-load data packet; the second bluetoothradio frequency module 3021 is specifically configured to send a no-load data packet carrying an audio stream playing instruction code to the first earphone.
The mobile terminal provided in the embodiment of the present invention can implement each process implemented by the mobile terminal in the method embodiments of fig. 1 to fig. 2, and is not described herein again to avoid repetition.
In the embodiment of the invention, after an audio file to be played is separated into a right channel audio stream and a left channel audio stream through a first earphone, the right channel audio stream is sent to a second earphone; after receiving the right channel audio stream, the second earphone generates a no-load data packet carrying an audio stream playing instruction code and sends the no-load data packet to the first earphone; the second earphone delays the preset time length to play the right sound channel audio stream; after the first earphone identifies the audio stream playing instruction code from the received no-load data packet, the left channel audio stream is played, because the no-load data packet is very small, namely the time consumed by the first earphone for receiving the no-load data packet can be ignored, which is equivalent to that after the first earphone identifies the audio stream playing instruction code, the left channel audio stream is immediately played, so that the first earphone and the second earphone almost simultaneously play, and the audio synchronous playing accuracy between the first earphone and the second earphone of the wireless earphone is improved. In addition, the second earphone is delayed for a preset time, so that the first earphone and the second earphone can almost achieve the effect of synchronous playing, and listening experience is improved.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The audio file playing method and the wireless answering device provided by the invention are introduced in detail, specific examples are applied in the text to explain the principle and the implementation mode of the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.