CN113422997A - Method and device for playing audio data and readable storage medium - Google Patents

Method and device for playing audio data and readable storage medium Download PDF

Info

Publication number
CN113422997A
CN113422997A CN202110688072.XA CN202110688072A CN113422997A CN 113422997 A CN113422997 A CN 113422997A CN 202110688072 A CN202110688072 A CN 202110688072A CN 113422997 A CN113422997 A CN 113422997A
Authority
CN
China
Prior art keywords
audio data
sound box
channel audio
data
information
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
Application number
CN202110688072.XA
Other languages
Chinese (zh)
Other versions
CN113422997B (en
Inventor
周岭松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Beijing Xiaomi Pinecone Electronic Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Beijing Xiaomi Pinecone Electronic Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd, Beijing Xiaomi Pinecone Electronic Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202110688072.XA priority Critical patent/CN113422997B/en
Publication of CN113422997A publication Critical patent/CN113422997A/en
Application granted granted Critical
Publication of CN113422997B publication Critical patent/CN113422997B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/436Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
    • H04N21/43615Interfacing a Home Network, e.g. for connecting the client to a plurality of peripherals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/436Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
    • H04N21/4363Adapting the video stream to a specific local network, e.g. a Bluetooth® network
    • H04N21/43637Adapting the video stream to a specific local network, e.g. a Bluetooth® network involving a wireless protocol, e.g. Bluetooth, RF or wireless LAN [IEEE 802.11]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • H04N21/4398Processing of audio elementary streams involving reformatting operations of audio signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Security & Cryptography (AREA)
  • Stereophonic System (AREA)

Abstract

The present disclosure provides a method, apparatus, and medium for playing audio data, the method including: acquiring multi-channel audio data; extracting first channel audio data and at least one second channel audio data from the multi-channel audio data, coding the first channel audio data, and adding a first time stamp to the coded first channel audio data to obtain first audio synchronous coded data; coding the second channel audio data, and adding a second timestamp to the coded second channel audio data to obtain second audio synchronous coded data, wherein the second timestamp is used for enabling the second sound box to be synchronous with the first sound box; sending the first audio synchronous encoding data to the first loudspeaker box; and sending the second audio synchronous coded data to the second loudspeaker box. According to the method and the device, the processing efficiency of the second loudspeaker box can be improved, the synchronization rate of audio playing can be improved, and the load of a wireless communication network can be reduced.

Description

Method and device for playing audio data and readable storage medium
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a method and an apparatus for playing audio data, and a readable storage medium.
Background
In one implementation, the same television is connected to two smart speakers simultaneously via short-range wireless communication technology (e.g., bluetooth or WIFI). A first sound box is arranged in the television. The two smart speakers include a second speaker 1 and a second speaker 2. The data of different sound channels in the audio data can be played simultaneously through the built-in first sound box and the two intelligent sound boxes in the television, so that surround sound is achieved, and compared with the situation that only the built-in first sound box of the television is used for playing, the auditory effect can be improved.
As shown in fig. 1, a processor in a television receives audio compressed data corresponding to 12 channels from a server through a network. The processor decodes the audio compression data and synchronously encodes the decoded data, wherein the synchronous encoding comprises adding a time stamp in each frame of encoded data, and the time stamp is used for synchronous playing among all devices. The processor sends the data subjected to synchronous coding to a first sound box arranged in the television, and sends the data subjected to synchronous coding to a second sound box 1 and a second sound box 2 through a short-distance wireless network.
And the first loudspeaker box decodes the synchronously coded data and extracts audio data of the 1 st channel to the 10 th channel from the decoded data.
The second speaker 1 decodes the synchronously encoded data, and extracts audio data of the 11 th channel from the decoded data.
The second speaker 2 decodes the synchronously encoded data, and extracts audio data of the 12 th channel from the decoded data.
And the first sound box, the second sound box 1 and the second sound box 2 synchronously play the acquired audio data according to the timestamp.
The television encodes audio data including 12 channels together, resulting in co-frequency encoded data corresponding to the 12 channels. After the synchronous coded data corresponding to the 12 sound channels are decoded, the data of the sound channels required by the first sound box and the second sound boxes in the television are mentioned. Thereby causing the following problems:
1. and synchronous coded data are sent to each second sound box, the synchronous coded data comprise data of 12 sound channels, the data volume is large, the network between the television and the second sound boxes causes transmission burden, real-time transmission is influenced, and the situations that the playing of the second sound boxes is blocked and the playing of the second sound boxes is asynchronous with the television are easily caused.
2. Every second audio amplifier all needs to carry out the decoding of synchronous coded data, when the complexity of decoding is higher, increases the processing burden of second audio amplifier, influences the throughput of second audio amplifier, causes the broadcast card pause of second audio amplifier and the circumstances of broadcast asynchronization with the TV easily.
3. In order to save the flow, if a coding algorithm with high compression ratio is used during synchronous coding, the sound quality is damaged, and the playing effect is influenced.
Disclosure of Invention
In view of the above, the present disclosure provides a method, an apparatus and a readable storage medium for playing audio data.
According to a first aspect of the embodiments of the present disclosure, there is provided a method for playing audio data, which is applied to a processor, where the processor is disposed in a first terminal, the first terminal is further provided with a first speaker communicatively connected to the processor, and the method includes:
acquiring multi-channel audio data;
extracting first channel audio data and at least one second channel audio data from the multi-channel audio data, wherein the first channel audio data is used for playing in the first loudspeaker box, and the second channel audio data is used for playing in at least one second loudspeaker box in wireless communication connection with the processor;
coding the first sound channel audio data, and adding a first time stamp to the coded first sound channel audio data to obtain first audio synchronous coded data, wherein the first time stamp is used for enabling the first loudspeaker box and the second loudspeaker box to be synchronous;
coding the second channel audio data, and adding a second timestamp to the coded second channel audio data to obtain second audio synchronous coded data, wherein the second timestamp is used for enabling the second sound box to be synchronous with the first sound box;
sending the first audio synchronous encoding data to the first loudspeaker box;
and sending the second audio synchronous coded data to the second loudspeaker box.
In an embodiment, the first channel audio data includes the same number of channels as the number of channels that the first speaker can play; the number of sound channels included in the second channel audio data is the same as the number of sound channels that can be played by the second loudspeaker box.
In an embodiment, if the multi-channel audio data includes a plurality of second-channel audio data, the encoding the second-channel audio data and adding a second timestamp to the encoded second-channel audio data to obtain second audio-synchronization encoded data includes:
respectively encoding each second channel audio data, and adding a corresponding second timestamp to each encoded second channel audio data to obtain second audio synchronous encoded data corresponding to each second channel audio data;
and transmitting each second audio synchronous coded data to the corresponding second loudspeaker box.
In one embodiment, a system time difference of a second speaker corresponding to each second audio synchronization encoded data is determined, wherein the system time difference is a difference of system time between the first speaker and the second speaker;
and sending each system time difference to a corresponding second sound box so that the second sound box is synchronous with the first sound box according to the corresponding second timestamp and the corresponding system time difference.
In an embodiment, the determining the system time difference of the second loudspeaker box corresponding to each second audio synchronization encoding data includes:
receiving first information from the second loudspeaker and sending second information to the second loudspeaker; receiving third information from the second sound box, wherein the first information is system time information of the second sound box, the second information is system time information of the first sound box, and the third information is system time information of the second sound box receiving the second information;
and determining the system time difference between the first loudspeaker box and the second loudspeaker box according to the first information, the system time information of the received first information, the second information and the third information.
In an embodiment, the method further comprises:
and sending a playing delay time length to the second sound box so that the second sound box is synchronous with the first sound box according to the playing delay time length, the corresponding system time difference and the corresponding second timestamp, wherein the playing delay time length is a difference value between the moment when the first sound box plays the first audio synchronous coded data and the first timestamp of the first audio synchronous coded data.
In an embodiment, the method further comprises:
receiving first information from the second loudspeaker, sending system time information of the received first information to the second loudspeaker, and sending second information to the second loudspeaker, so that the second loudspeaker determines a system time difference between the first loudspeaker and the second loudspeaker, and synchronizes with the first loudspeaker according to the system time difference and a corresponding second timestamp.
In an embodiment, the method further comprises:
and sending a playing delay time length to the second sound box so that the second sound box is synchronous with the first sound box according to the playing delay time length, the corresponding system time difference and the corresponding second timestamp, wherein the playing delay time length is a difference value between the moment when the first sound box plays the first audio synchronous coded data and the first timestamp of the first audio synchronous coded data.
In an embodiment, the encoding the second channel audio data includes:
determining wireless network delay between the first sound box and each second sound box corresponding to the second channel audio data;
determining a code rate corresponding to the wireless network delay;
encoding the second channel audio data using the code rate.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for playing audio data, which is applied to a first terminal, the apparatus includes a processor, the first terminal is further provided with a first speaker communicatively connected to the processor, and the apparatus includes:
the acquisition module is used for acquiring multi-channel audio data;
an extracting module, configured to extract first channel audio data and at least one second channel audio data from the multi-channel audio data, where the first channel audio data is used for playing in the first loudspeaker box, and the second channel audio data is used for playing in at least one second loudspeaker box connected to the processor in a wireless communication manner;
the encoding module is configured to encode the first channel audio data, and add a first timestamp to the encoded first channel audio data to obtain first audio synchronous encoded data, where the first timestamp is used to synchronize the first sound box with the second sound box; coding the second channel audio data, and adding a second timestamp to the coded second channel audio data to obtain second audio synchronous coded data, wherein the second timestamp is used for enabling the second sound box to be synchronous with the first sound box;
the first sending module is used for sending the first audio synchronous coded data to the first loudspeaker box; and sending the second audio synchronous coded data to the second loudspeaker box.
In an embodiment, the first channel audio data includes the same number of channels as the number of channels that the first speaker can play; the number of sound channels included in the second channel audio data is the same as the number of sound channels that can be played by the second loudspeaker box.
In an embodiment, the encoding module is further configured to, when the multi-channel audio data includes a plurality of second-channel audio data, obtain second audio synchronization encoding data by using the following method: respectively encoding each second channel audio data, and adding a corresponding second timestamp to each encoded second channel audio data to obtain second audio synchronous encoded data corresponding to each second channel audio data;
the first sending module is further configured to send each second audio synchronization encoded data to a corresponding second sound box.
In one embodiment, the apparatus further comprises:
the determining module is used for determining a system time difference of a second sound box corresponding to each second audio synchronous coded data, wherein the system time difference is a difference of system time between the first sound box and the second sound box;
and the second sending module is used for sending each system time difference to a corresponding second sound box so that the second sound box is synchronous with the first sound box according to the corresponding second timestamp and the corresponding system time difference.
In one embodiment, the apparatus further comprises:
the first receiving module is used for receiving first information from the second loudspeaker box;
the third sending module is used for sending second information to the second sound box;
the second receiving module is used for receiving third information from the second loudspeaker box;
the first information is system time information of the second sound box, the second information is system time information of the first sound box, and the third information is system time information of the second sound box receiving the second information;
the first determining module is configured to determine a system time difference of a second loudspeaker box corresponding to each second audio synchronization encoded data by using the following method: and determining the system time difference between the first loudspeaker box and the second loudspeaker box according to the first information, the system time information of the received first information, the second information and the third information.
In one embodiment, the apparatus further comprises:
and a fourth sending module, configured to send the play delay duration to the second sound box, so that the second sound box is synchronized with the first sound box according to the play delay duration, the corresponding system time difference, and the corresponding second timestamp, where the play delay duration is a difference between a time at which the first sound box plays the first audio-frequency synchronous encoded data and the first timestamp of the first audio-frequency synchronous encoded data.
In one embodiment, the apparatus further comprises:
the third receiving module is used for receiving the first information from the second loudspeaker box;
a fifth sending module, configured to send, to the second sound box, system time information obtained by receiving the first information;
and the sixth sending module is configured to send second information to the second sound box, so that the second sound box determines a system time difference between the first sound box and the second sound box, and synchronizes with the first sound box according to the system time difference and a corresponding second timestamp.
In one embodiment, the apparatus further comprises:
a seventh sending module, configured to send a play delay duration to the second sound box, so that the second sound box is synchronized with the first sound box according to the play delay duration, the corresponding system time difference, and the corresponding second timestamp, where the play delay duration is a difference between a time at which the first sound box plays the first audio-frequency synchronous encoded data and a first timestamp of the first audio-frequency synchronous encoded data.
In one embodiment, the apparatus further comprises:
the second determining module is used for determining wireless network delay between the first loudspeaker box and each second loudspeaker box corresponding to the second channel audio data;
a third determining module, configured to determine a code rate corresponding to the wireless network delay;
the encoding module is further configured to encode the second channel audio data using: encoding the second channel audio data using the code rate.
According to a third aspect of the embodiments of the present disclosure, there is provided an apparatus for playing audio data, applied to a processor, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute executable instructions in the memory to implement the steps of the method.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon executable instructions that, when executed by a processor, implement the steps of the method.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: the second audio synchronous coded data received by each second sound box only comprises audio synchronous coded data of partial sound channels in the multi-sound-channel audio data, and each second sound box does not need to decode data of all sound channels in the multi-sound-channel audio data during decoding, so that the processing efficiency of the second sound box can be improved, and the synchronous rate of audio playing can be improved. Moreover, when the processor of the first terminal performs compression coding on the second audio synchronous coded data which needs to be sent to each second sound box, the wireless data transmission quantity can be reduced, the load of a wireless communication network is reduced, and the audio playing synchronization rate is improved while the stereo playing effect is realized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flow chart of a method of playing audio data in the prior art;
FIG. 2 is a flow diagram illustrating a method of playing audio data in accordance with an exemplary embodiment;
FIG. 3 is a flow chart illustrating a method of playing audio data in an example according to an exemplary embodiment;
FIG. 4 is a schematic diagram illustrating a processor and a second loudspeaker communicating system time information in accordance with an exemplary embodiment;
FIG. 5 is another schematic diagram illustrating another processor communicating system time information with a second loudspeaker in accordance with an exemplary embodiment;
FIG. 6 is another schematic diagram illustrating another processor communicating system time information with a second loudspeaker in accordance with an exemplary embodiment;
fig. 7 is a block diagram illustrating an apparatus for playing audio data according to an exemplary embodiment;
fig. 8 is another block diagram illustrating an apparatus for playing audio data according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the embodiments in this disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the embodiments in the present disclosure, as detailed in the appended claims.
The terminology used in the embodiments of the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the embodiments of the present disclosure. As used in the disclosed embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
The embodiment of the disclosure provides a method for playing audio data, which is applied to a processor, wherein the processor is arranged at a first terminal, and the first terminal is further provided with a first sound box in communication connection with the processor. This first terminal is a terminal that can play audio data, for example: televisions, mobile phones, computers, tablets, etc.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method of playing audio data according to an exemplary embodiment. As shown in fig. 2, the method includes:
step S11, acquiring multi-channel audio data;
step S12, extracting first channel audio data and at least one second channel audio data from the multi-channel audio data, wherein the first channel audio data is used for playing in the first speaker, and the second channel audio data is used for playing in at least one second speaker connected to the processor in wireless communication;
step S13, encoding the first channel audio data, and adding a first timestamp to the encoded first channel audio data to obtain first audio synchronization encoded data, where the first timestamp is used to synchronize the first speaker with the second speaker; coding the second channel audio data, and adding a second timestamp to the coded second channel audio data to obtain second audio synchronous coded data, wherein the second timestamp is used for enabling the second sound box to be synchronous with the first sound box;
step S14, sending the first audio synchronous coded data to the first sound box; and sending the second audio synchronous coded data to the second loudspeaker box.
In some possible embodiments, the first channel audio data is lossless encoded (e.g., lossless PCM encoded), and the second channel audio data is lossy encoded in step S13.
In some possible embodiments, the multi-channel audio data is divided into a plurality of frames at a fixed time duration, and each frame of data includes data of all channels. Adding a first time stamp to each frame in the encoded first channel audio data. And adding a second time stamp to each frame in each second channel of the encoded audio data.
The first time stamp in the encoded first channel audio data corresponding to the same frame of multi-channel audio data is the same as the second time stamp in each encoded second channel audio data corresponding to the same frame of multi-channel audio data.
In some possible embodiments, one of the second audio-synchronization encoded data is sent to a plurality of second speakers, so that the plurality of second speakers play the same second audio-synchronization encoded data.
In the embodiment of the disclosure, the second audio synchronous coded data received by each second sound box only contains audio synchronous coded data of a part of channels in the multi-channel audio data, and each second sound box does not need to decode data of all channels in the multi-channel audio data when decoding, so that the processing efficiency of the second sound box can be improved, and the synchronization rate of audio playing can be improved. Moreover, when the processor of the first terminal performs compression coding on the second audio synchronous coded data which needs to be sent to each second sound box, the wireless data transmission quantity can be reduced, the load of a wireless communication network is reduced, and the audio playing synchronization rate is improved while the stereo playing effect is realized.
The embodiment of the present disclosure provides a method for playing audio data, which is applied to a processor, and includes the method shown in fig. 1, and:
the number of the sound channels included in the first sound channel audio data is the same as the number of the sound channels which can be played by the first loudspeaker box; the number of sound channels included in the second channel audio data is the same as the number of sound channels that can be played by the second loudspeaker box.
In one embodiment, the first loudspeaker box is a multi-channel device, and the first channel audio data includes a plurality of channels; the second loudspeaker box is a multi-channel device, and the second channel audio data comprises a plurality of channels.
In an example, the first terminal is a television, and a first sound box is built in the television. The second audio amplifier is intelligent audio amplifier. The number of sound channels that can be played by the first sound box is 10. The number of sound channels that each smart speaker can play is 2. When the multi-channel audio data corresponds to 12 channels, the television and a smart speaker are used for playing.
In one embodiment, the first loudspeaker box is a multi-channel device, and the first channel audio data includes a plurality of channels; the second loudspeaker box is a single sound channel device, and the second sound channel audio data comprises 1 sound channel.
In an example, the first terminal is a television, and a first sound box is built in the television. The second audio amplifier is intelligent audio amplifier. The number of sound channels that can be played by the first sound box is 10. The number of sound channels that each smart speaker can play is 1. When the multi-channel audio data corresponds to 12 channels, the television and the two smart speakers are used for playing.
As shown in fig. 3, the first terminal is a television, and the television includes a processor and a first speaker. There are two second speakers, which are the second speaker 1 and the second speaker 2, respectively. The method for playing audio data comprises the following steps:
the processor acquires 12-channel audio data.
First channel audio data and 2 second channel audio data are extracted from the 12-channel audio data. Wherein:
the first channel audio data comprises data of 1 st to 10 th channels and is used for being played in the first loudspeaker box;
the first second channel audio data comprises data of an 11 th channel and is used for being played in a second sound box 1 in wireless communication connection with the processor;
the second channel audio data includes data of a 12 th channel for playing in a second speaker 2 connected in wireless communication with the processor.
Coding the first sound channel audio data, and adding a first time stamp to the coded first sound channel audio data to obtain first audio synchronous coded data, wherein the first time stamp is used for enabling the first loudspeaker box and the second loudspeaker box to be synchronous; and coding the second channel audio data, and adding a second timestamp to the coded second channel audio data to obtain second audio synchronous coded data, wherein the second timestamp is used for enabling the second sound box to be synchronous with the first sound box.
Sending the first audio synchronous encoding data to the first loudspeaker box; and sending the first second audio synchronous coded data to the second loudspeaker box 1, and sending the second audio synchronous coded data to the second loudspeaker box 2.
The first sound box plays the first audio synchronous coded data, the second sound box 1 plays the first second audio synchronous coded data, and the second sound box 2 plays the second audio synchronous coded data, so that the synchronous stereo playing effect is realized.
The embodiment of the present disclosure provides a method for playing audio data, which is applied to a processor, and includes the method shown in fig. 1, and:
if the multi-channel audio data includes a plurality of second channel audio data, the step S13 encodes the second channel audio data, and adds a second time stamp to the encoded second channel audio data to obtain second audio synchronization encoded data, including:
respectively encoding each second channel audio data, and adding a corresponding second timestamp to each encoded second channel audio data to obtain second audio synchronous encoded data corresponding to each second channel audio data;
and transmitting each second audio synchronous coded data to the corresponding second loudspeaker box.
In some possible embodiments, the same second audio-frequency synchronous coded data is sent to a plurality of second speakers, so that the plurality of second speakers play the same second audio-frequency synchronous coded data.
In some possible embodiments, the same second audio-frequency synchronous coded data is transmitted to only one second loudspeaker box, so that each second loudspeaker box plays different second audio-frequency synchronous coded data.
In the embodiment of the present disclosure, the multi-channel audio data includes a plurality of second channel audio data, and when a plurality of second speakers are used, each second channel audio data is encoded respectively, and a corresponding second timestamp is set, and each second audio synchronous encoded data is sent to the corresponding second speaker, thereby achieving a better synchronous stereo effect.
The embodiment of the present disclosure provides a method for playing audio data, which is applied to a processor, and includes the method shown in fig. 1, and:
the method further comprises the following steps:
step 1, determining a system time difference of a second sound box corresponding to each second audio synchronous coded data, wherein the system time difference is a difference of system time between the first sound box and the second sound box;
and 2, sending the system time difference to a corresponding second sound box so that the second sound box is synchronous with the first sound box according to the corresponding second timestamp and the corresponding system time difference.
Since the processor is located in the same first terminal as the first speaker, the system time of the processor is considered to be the same as the system time of the first speaker.
In one example, the first terminal is a television, and a first sound box is arranged in the television. The television is connected with the second loudspeaker box 1 and the second loudspeaker box 2 through Bluetooth.
The system time difference between the first sound box and the second sound box 1 is delta 1. The system time difference between the first sound box and the second sound box 2 is delta 2.
The first time stamp of the first audio synchronization encoding data of the Nth frame is T0, and the second time stamps of the two second audio synchronization encoding data of the Nth frame are both T0.
The first loudspeaker plays the frame of first audio-synchronization encoded data at time T0.
The second sound box 1 plays the second audio synchronous coded data corresponding to the second sound box 1 at the time T0 +. DELTA.1.
The second sound box 2 plays the second audio synchronous coded data corresponding to the second sound box 2 at the time T0 +. DELTA.2.
Therefore, the audio playing of the three sound boxes is synchronous.
In an embodiment, the determining the system time difference of the second loudspeaker box corresponding to each second audio synchronization encoding data in step 1 includes:
receiving first information from the second loudspeaker and sending second information to the second loudspeaker; receiving third information from the second sound box, wherein the first information is system time information of the second sound box, the second information is system time information of the first sound box, and the third information is system time information of the second sound box receiving the second information; and determining the system time difference between the first loudspeaker box and the second loudspeaker box according to the first information, the system time information of the received first information, the second information and the third information.
In some possible embodiments, the processor and the second loudspeaker are separated by a fixed time interval to perform interaction of system time information. For example, the fixed duration may be set to 1 second, 2 seconds, or other duration.
In one example, as shown in FIG. 4, the processor receives T1 from the second enclosure (T1 is the system time for the second enclosure), determines that T1 was received at T2, sends T3 to the second enclosure (T3 is the system time for the processor), and receives T4 from the second enclosure (T4 is the system time for the second enclosure to receive T3). The processor determines a system time difference between the first enclosure and the second enclosure based on T1, T2, T3, and T4.
The following is described in detail by way of a specific example:
the system time difference between the processor and the second loudspeaker box is 10 seconds, and the network transmission delay between the processor and the second loudspeaker box is 5 seconds.
As shown in fig. 5, the second speaker sends the system time to the processor when the system time is X hours, Y minutes and 0 seconds of the day, and therefore, since only calculations in the second order are involved in this example, T1 may be determined to be 0.
And the processor receives the information sent by the second loudspeaker box when the system time is X hours, Y minutes and 15 seconds. Then T2 is 15.
The processor sends feedback information to the second speaker, including T2, to notify the second speaker of T2.
And the processor sends the system time to the second loudspeaker box when the system time is X hours, Y minutes and 25 seconds. Then T3 is 25.
And the second loudspeaker box receives the information sent by the processor when the system time is X, Y minutes and 20 seconds. Then T4 is 20.
Setting delta as the system time difference between the processor and the second loudspeaker box, and tau as the wireless network delay between the processor and the second loudspeaker box.
The following equations (1) and (2) are known from the transmission principle:
T4-T3=△+τ; (1)
T2-T1=-△+τ; (2)
the second sound box can calculate delta and tau according to the formula (1) and the formula (2), and specifically comprises the following steps:
△=[(T2-T1)-(T4-T3)]/2
τ=[(T2-T1)+(T4-T3)]/2
the second sound box is obtained by calculation according to T1, T2, T3 and T4:
△=[(15-0)-(20-25)]/2=10
τ=[(15-0)+(20-25)]/2=5
in consideration of the system time difference with the first sound box, the second sound box plays audio data at the time of T0+ delta for the audio data played by the first sound box at the time of T0, so that the playing synchronization can be realized.
In the embodiment of the disclosure, the second loudspeaker box determines the system time difference between the first loudspeaker box and the second loudspeaker box through the interaction between the processor and the second loudspeaker box about the system time, so that the system time difference is also considered while the time stamp is considered during playing, and thus, when the system time of the loudspeaker boxes is inconsistent, the playing synchronization is realized.
In an embodiment, the method further comprises: sending a play delay duration T to the second speakerdelaySo that said firstAnd the two sound boxes are synchronous with the first sound box according to the playing delay time length, the corresponding system time difference and the corresponding second time stamp, wherein the playing delay time length is the difference value between the moment when the first sound box plays the first audio synchronous coded data and the first time stamp of the first audio synchronous coded data.
Setting the playback delay period T to allow sufficient processing time for the processor and the second speakerdelayFor audio data with time stamp T0, the first speaker is at T0+ TdelayBroadcasting at the moment, the second sound box is at T0+ delta + TdelayBroadcasting at any moment, thereby realizing the synchronization of broadcasting.
The embodiment of the present disclosure provides a method for playing audio data, which is applied to a processor, and includes the method shown in fig. 1, and further includes:
receiving first information from the second loudspeaker, sending system time information of the received first information to the second loudspeaker, and sending second information to the second loudspeaker, so that the second loudspeaker determines a system time difference between the first loudspeaker and the second loudspeaker, and synchronizes with the first loudspeaker according to the system time difference and a corresponding second timestamp.
In one example, as shown in FIG. 6, the second speaker sends T1 to the processor (T1 is the system time of the processor), the second speaker receives T2 from the processor (T2 is the system time of the processor receiving T1), the processor sends T3 to the second speaker (T3 is the system time of the processor), and the second speaker determines that the time of receiving T3 from the processor is T4. The second enclosure determines the system time difference between the first enclosure and the second enclosure from known T1, T2, T3, and T4.
The difference between the embodiment of the present disclosure and the previous embodiment is that the processor in the previous embodiment calculates the system time difference between the first sound box and the second sound box and then notifies the second sound box. The principle of calculating the system time difference is the same as that in the previous embodiment, and is not described herein again.
In the disclosed embodiment, the system time difference between the processor and the second loudspeaker box can be calculated by the second loudspeaker box through the transmission of the system time information between the processor and the second loudspeaker box, so that the playing time is adjusted, and the playing synchronization is realized.
The embodiment of the present disclosure provides a method for playing audio data, which is applied to a processor, and includes the method shown in fig. 1, and further includes:
receiving first information from the second loudspeaker, sending system time information of the received first information to the second loudspeaker, and sending second information to the second loudspeaker, so that the second loudspeaker determines a system time difference between the first loudspeaker and the second loudspeaker, and synchronizes with the first loudspeaker according to the system time difference and a corresponding second timestamp.
And sending a playing delay time length to the second sound box so that the second sound box is synchronous with the first sound box according to the playing delay time length, the corresponding system time difference and the corresponding second timestamp, wherein the playing delay time length is a difference value between the moment when the first sound box plays the first audio synchronous coded data and the first timestamp of the first audio synchronous coded data.
The embodiment of the present disclosure provides a method for playing audio data, which is applied to a processor, and includes the method shown in fig. 1, and:
encoding the second channel audio data in step S13 includes:
determining wireless network delay between the first sound box and each second sound box corresponding to the second channel audio data;
determining a code rate corresponding to the wireless network delay;
encoding the second channel audio data using the code rate.
In one example, the method includes that each monaural synchronous audio data in the synchronous audio data of the K channels is coded by the OPUS, the code rate is 96kbps, and when the fact that the value of wireless network delay tau between a processor and a certain second loudspeaker box is small is detected, namely the network condition is good, the code rate of the OPUS coder can be increased; when the value of the wireless network delay tau between the processor and the second loudspeaker box is detected to be large, namely the network condition is poor, the code rate of the OPUS encoder can be reduced.
In some possible embodiments, when each monaural synchronous audio data in the K channels of synchronous audio data is encoded using a corresponding code rate, the code rate is positively correlated with the wireless network delay.
In the embodiment of the disclosure, the coding rate is adjusted according to the wireless network delay, the coding rate matched with the network delay is provided, and the available network bandwidth is effectively utilized.
The embodiment of the disclosure provides a device for playing audio data, which is applied to a first terminal, the device comprises a processor, and the first terminal is further provided with a first sound box in communication connection with the processor. This first terminal is a terminal that can play audio data, for example: televisions, mobile phones, computers, tablets, etc.
Referring to fig. 7, fig. 7 is a block diagram illustrating an apparatus for playing audio data according to an exemplary embodiment. As shown in fig. 7, the method includes:
an obtaining module 71, configured to obtain multi-channel audio data;
an extracting module 72, configured to extract first channel audio data and at least one second channel audio data from the multi-channel audio data, where the first channel audio data is used for playing in the first loudspeaker box, and the second channel audio data is used for playing in at least one second loudspeaker box connected to the processor in a wireless communication manner;
the encoding module 73 is configured to encode the first channel audio data, and add a first timestamp to the encoded first channel audio data to obtain first audio synchronization encoded data, where the first timestamp is used to synchronize the first loudspeaker and the second loudspeaker; coding the second channel audio data, and adding a second timestamp to the coded second channel audio data to obtain second audio synchronous coded data, wherein the second timestamp is used for enabling the second sound box to be synchronous with the first sound box;
a first sending module 74, configured to send the first audio synchronization encoded data to the first loudspeaker; and sending the second audio synchronous coded data to the second loudspeaker box.
The embodiment of the present disclosure provides an apparatus for playing audio data, which is applied to a processor, and includes the apparatus shown in fig. 7, and:
the number of the sound channels included in the first sound channel audio data is the same as the number of the sound channels which can be played by the first loudspeaker box; the number of sound channels included in the second channel audio data is the same as the number of sound channels that can be played by the second loudspeaker box.
The embodiment of the present disclosure provides an apparatus for playing audio data, which is applied to a processor, and includes the apparatus shown in fig. 7, and:
the encoding module 73 is further configured to, when the multi-channel audio data includes a plurality of second channel audio data, obtain second audio synchronization encoded data by using the following method: respectively encoding each second channel audio data, and adding a corresponding second timestamp to each encoded second channel audio data to obtain second audio synchronous encoded data corresponding to each second channel audio data;
the first sending module 74 is further configured to send each second audio synchronization encoded data to the corresponding second sound box.
The embodiment of the present disclosure provides an apparatus for playing audio data, which is applied to a processor, and includes the apparatus shown in fig. 7, and:
the determining module is used for determining a system time difference of a second sound box corresponding to each second audio synchronous coded data, wherein the system time difference is a difference of system time between the first sound box and the second sound box;
and the second sending module is used for sending each system time difference to a corresponding second sound box so that the second sound box is synchronous with the first sound box according to the corresponding second timestamp and the corresponding system time difference.
The embodiment of the present disclosure provides an apparatus for playing audio data, which is applied to a processor, and includes the apparatus shown in fig. 7, and:
the device further comprises:
the first receiving module is used for receiving first information from the second loudspeaker box;
the third sending module is used for sending second information to the second sound box;
the second receiving module is used for receiving third information from the second loudspeaker box;
the first information is system time information of the second sound box, the second information is system time information of the first sound box, and the third information is system time information of the second sound box receiving the second information;
the first determining module is configured to determine a system time difference of a second loudspeaker box corresponding to each second audio synchronization encoded data by using the following method: and determining the system time difference between the first loudspeaker box and the second loudspeaker box according to the first information, the system time information of the received first information, the second information and the third information.
In one embodiment, the apparatus further comprises:
and a fourth sending module, configured to send the play delay duration to the second sound box, so that the second sound box is synchronized with the first sound box according to the play delay duration, the corresponding system time difference, and the corresponding second timestamp, where the play delay duration is a difference between a time at which the first sound box plays the first audio-frequency synchronous encoded data and the first timestamp of the first audio-frequency synchronous encoded data.
The embodiment of the present disclosure provides an apparatus for playing audio data, which is applied to a processor, and includes the apparatus shown in fig. 7, and:
the device further comprises:
the third receiving module is used for receiving the first information from the second loudspeaker box;
a fifth sending module, configured to send, to the second sound box, system time information obtained by receiving the first information;
and the sixth sending module is configured to send second information to the second sound box, so that the second sound box determines a system time difference between the first sound box and the second sound box, and synchronizes with the first sound box according to the system time difference and a corresponding second timestamp.
In one embodiment, the apparatus further comprises:
a seventh sending module, configured to send a play delay duration to the second sound box, so that the second sound box is synchronized with the first sound box according to the play delay duration, the corresponding system time difference, and the corresponding second timestamp, where the play delay duration is a difference between a time at which the first sound box plays the first audio-frequency synchronous encoded data and a first timestamp of the first audio-frequency synchronous encoded data.
The embodiment of the present disclosure provides an apparatus for playing audio data, which is applied to a processor, and includes the apparatus shown in fig. 7, and:
the device further comprises:
the second determining module is used for determining wireless network delay between the first loudspeaker box and each second loudspeaker box corresponding to the second channel audio data;
a third determining module, configured to determine a code rate corresponding to the wireless network delay;
the encoding module is further configured to encode the second channel audio data using: encoding the second channel audio data using the code rate.
The embodiment of the present disclosure provides a playing device, which is applied to a terminal, and includes:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute executable instructions in the memory to implement the steps of the method of playing audio data.
The disclosed embodiments provide a non-transitory computer readable storage medium having stored thereon executable instructions that, when executed by a processor, implement the steps of the method of playing audio data.
Fig. 8 is a block diagram illustrating an apparatus 800 for playing audio data according to an example embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 8, the apparatus 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power component 806 provides power to the various components of device 800. The power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed state of the device 800, the relative positioning of the components, such as a display and keypad of the apparatus 800, the sensor assembly 814 may also detect a change in position of the apparatus 800 or a component of the apparatus 800, the presence or absence of user contact with the apparatus 800, orientation or acceleration/deceleration of the apparatus 800, and a change in temperature of the apparatus 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the embodiments of the disclosure following, in general, the principles of the embodiments of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the embodiments pertain. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosed embodiments being indicated by the following claims.
It is to be understood that the embodiments of the present disclosure are not limited to the precise arrangements described above and shown in the drawings, and that various combinations, substitutions, modifications, and changes of the method steps or terminal assemblies disclosed in the present disclosure may be made without departing from the scope thereof, and are intended to be included within the scope of the present disclosure. The scope of the disclosure as claimed is limited by the claims appended hereto.
It should be noted that, in the present disclosure, 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.

Claims (20)

1. A method for playing audio data is applied to a processor, the processor is arranged at a first terminal, the first terminal is also provided with a first sound box which is in communication connection with the processor, and the method is characterized by comprising the following steps:
acquiring multi-channel audio data;
extracting first channel audio data and at least one second channel audio data from the multi-channel audio data, wherein the first channel audio data is used for playing in the first loudspeaker box, and the second channel audio data is used for playing in at least one second loudspeaker box in wireless communication connection with the processor;
coding the first sound channel audio data, and adding a first time stamp to the coded first sound channel audio data to obtain first audio synchronous coded data, wherein the first time stamp is used for enabling the first loudspeaker box and the second loudspeaker box to be synchronous;
coding the second channel audio data, and adding a second timestamp to the coded second channel audio data to obtain second audio synchronous coded data, wherein the second timestamp is used for enabling the second sound box to be synchronous with the first sound box;
sending the first audio synchronous encoding data to the first loudspeaker box;
and sending the second audio synchronous coded data to the second loudspeaker box.
2. The method of claim 1,
the number of the sound channels included in the first sound channel audio data is the same as the number of the sound channels which can be played by the first loudspeaker box; the number of sound channels included in the second channel audio data is the same as the number of sound channels that can be played by the second loudspeaker box.
3. The method of claim 1, wherein if the multi-channel audio data includes a plurality of second channel audio data, the encoding the second channel audio data and adding a second time stamp to the encoded second channel audio data to obtain second audio synchronization encoded data comprises:
respectively encoding each second channel audio data, and adding a corresponding second timestamp to each encoded second channel audio data to obtain second audio synchronous encoded data corresponding to each second channel audio data;
and transmitting each second audio synchronous coded data to the corresponding second loudspeaker box.
4. The method of claim 3, further comprising:
determining a system time difference of a second sound box corresponding to each second audio synchronous encoding data, wherein the system time difference is a difference of system time between the first sound box and the second sound box;
and sending each system time difference to a corresponding second sound box so that the second sound box is synchronous with the first sound box according to the corresponding second timestamp and the corresponding system time difference.
5. The method of claim 4,
the determining the system time difference of the second loudspeaker box corresponding to each second audio synchronous coded data comprises:
receiving first information from the second loudspeaker and sending second information to the second loudspeaker; receiving third information from the second sound box, wherein the first information is system time information of the second sound box, the second information is system time information of the first sound box, and the third information is system time information of the second sound box receiving the second information;
and determining the system time difference between the first loudspeaker box and the second loudspeaker box according to the first information, the system time information of the received first information, the second information and the third information.
6. The method according to claim 4 or 5,
the method further comprises the following steps:
and sending a playing delay time length to the second sound box so that the second sound box is synchronous with the first sound box according to the playing delay time length, the corresponding system time difference and the corresponding second timestamp, wherein the playing delay time length is a difference value between the moment when the first sound box plays the first audio synchronous coded data and the first timestamp of the first audio synchronous coded data.
7. The method of claim 1,
the method further comprises the following steps:
receiving first information from the second loudspeaker, sending system time information of the received first information to the second loudspeaker, and sending second information to the second loudspeaker, so that the second loudspeaker determines a system time difference between the first loudspeaker and the second loudspeaker, and synchronizes with the first loudspeaker according to the system time difference and a corresponding second timestamp.
8. The method of claim 7,
the method further comprises the following steps:
and sending a playing delay time length to the second sound box so that the second sound box is synchronous with the first sound box according to the playing delay time length, the corresponding system time difference and the corresponding second timestamp, wherein the playing delay time length is a difference value between the moment when the first sound box plays the first audio synchronous coded data and the first timestamp of the first audio synchronous coded data.
9. The method of claim 1,
the encoding the second channel audio data includes:
determining wireless network delay between the first sound box and each second sound box corresponding to the second channel audio data;
determining a code rate corresponding to the wireless network delay;
encoding the second channel audio data using the code rate.
10. The utility model provides a device of broadcast audio data, is applied to first terminal, the device includes the treater, first terminal still be provided with treater communication connection's first audio amplifier, its characterized in that includes:
the acquisition module is used for acquiring multi-channel audio data;
an extracting module, configured to extract first channel audio data and at least one second channel audio data from the multi-channel audio data, where the first channel audio data is used for playing in the first loudspeaker box, and the second channel audio data is used for playing in at least one second loudspeaker box connected to the processor in a wireless communication manner;
the encoding module is configured to encode the first channel audio data, and add a first timestamp to the encoded first channel audio data to obtain first audio synchronous encoded data, where the first timestamp is used to synchronize the first sound box with the second sound box; coding the second channel audio data, and adding a second timestamp to the coded second channel audio data to obtain second audio synchronous coded data, wherein the second timestamp is used for enabling the second sound box to be synchronous with the first sound box;
the first sending module is used for sending the first audio synchronous coded data to the first loudspeaker box; and sending the second audio synchronous coded data to the second loudspeaker box.
11. The apparatus of claim 10,
the number of the sound channels included in the first sound channel audio data is the same as the number of the sound channels which can be played by the first loudspeaker box; the number of sound channels included in the second channel audio data is the same as the number of sound channels that can be played by the second loudspeaker box.
12. The apparatus of claim 10,
the encoding module is further configured to, when the multi-channel audio data includes a plurality of second-channel audio data, obtain second audio synchronization encoded data by using the following method: respectively encoding each second channel audio data, and adding a corresponding second timestamp to each encoded second channel audio data to obtain second audio synchronous encoded data corresponding to each second channel audio data;
the first sending module is further configured to send each second audio synchronization encoded data to a corresponding second sound box.
13. The apparatus of claim 12, further comprising:
the determining module is used for determining a system time difference of a second sound box corresponding to each second audio synchronous coded data, wherein the system time difference is a difference of system time between the first sound box and the second sound box;
and the second sending module is used for sending each system time difference to a corresponding second sound box so that the second sound box is synchronous with the first sound box according to the corresponding second timestamp and the corresponding system time difference.
14. The apparatus of claim 13,
the device further comprises:
the first receiving module is used for receiving first information from the second loudspeaker box;
the third sending module is used for sending second information to the second sound box;
the second receiving module is used for receiving third information from the second loudspeaker box;
the first information is system time information of the second sound box, the second information is system time information of the first sound box, and the third information is system time information of the second sound box receiving the second information;
the first determining module is configured to determine a system time difference of a second loudspeaker box corresponding to each second audio synchronization encoded data by using the following method: and determining the system time difference between the first loudspeaker box and the second loudspeaker box according to the first information, the system time information of the received first information, the second information and the third information.
15. The apparatus of claim 13 or 14,
the device further comprises:
and a fourth sending module, configured to send the play delay duration to the second sound box, so that the second sound box is synchronized with the first sound box according to the play delay duration, the corresponding system time difference, and the corresponding second timestamp, where the play delay duration is a difference between a time at which the first sound box plays the first audio-frequency synchronous encoded data and the first timestamp of the first audio-frequency synchronous encoded data.
16. The apparatus of claim 10,
the device further comprises:
the third receiving module is used for receiving the first information from the second loudspeaker box;
a fifth sending module, configured to send, to the second sound box, system time information obtained by receiving the first information;
and the sixth sending module is configured to send second information to the second sound box, so that the second sound box determines a system time difference between the first sound box and the second sound box, and synchronizes with the first sound box according to the system time difference and a corresponding second timestamp.
17. The apparatus of claim 16,
the device further comprises:
a seventh sending module, configured to send a play delay duration to the second sound box, so that the second sound box is synchronized with the first sound box according to the play delay duration, the corresponding system time difference, and the corresponding second timestamp, where the play delay duration is a difference between a time at which the first sound box plays the first audio-frequency synchronous encoded data and a first timestamp of the first audio-frequency synchronous encoded data.
18. The apparatus of claim 10,
the device further comprises:
the second determining module is used for determining wireless network delay between the first loudspeaker box and each second loudspeaker box corresponding to the second channel audio data;
a third determining module, configured to determine a code rate corresponding to the wireless network delay;
the encoding module is further configured to encode the second channel audio data using: encoding the second channel audio data using the code rate.
19. An apparatus for playing audio data, applied to a mobile terminal, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute executable instructions in the memory to implement the steps of the method of any one of claims 1 to 9.
20. A non-transitory computer readable storage medium having stored thereon executable instructions, wherein the executable instructions, when executed by a processor, implement the steps of the method of any one of claims 1 to 9.
CN202110688072.XA 2021-06-21 2021-06-21 Method and device for playing audio data and readable storage medium Active CN113422997B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110688072.XA CN113422997B (en) 2021-06-21 2021-06-21 Method and device for playing audio data and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110688072.XA CN113422997B (en) 2021-06-21 2021-06-21 Method and device for playing audio data and readable storage medium

Publications (2)

Publication Number Publication Date
CN113422997A true CN113422997A (en) 2021-09-21
CN113422997B CN113422997B (en) 2023-02-28

Family

ID=77789602

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110688072.XA Active CN113422997B (en) 2021-06-21 2021-06-21 Method and device for playing audio data and readable storage medium

Country Status (1)

Country Link
CN (1) CN113422997B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115567086A (en) * 2022-09-09 2023-01-03 安克创新科技股份有限公司 Audio transmission device, audio playback device, and audio transmission and synchronization system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107333339A (en) * 2017-05-16 2017-11-07 恒玄科技(上海)有限公司 Audio data transmission method and double wireless headsets between a kind of pair of wireless headset
CN109215669A (en) * 2017-07-06 2019-01-15 中国电影科学技术研究所 Wireless sound box multi-channel synchronous system and method
CN109635133A (en) * 2018-12-18 2019-04-16 腾讯音乐娱乐科技(深圳)有限公司 Visualize audio frequency playing method, device, electronic equipment and storage medium
WO2020107466A1 (en) * 2018-11-30 2020-06-04 华为技术有限公司 Point to multi-point data transmission method and device
CN112165645A (en) * 2020-09-28 2021-01-01 北京小米松果电子有限公司 Control method of playback device, and computer storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107333339A (en) * 2017-05-16 2017-11-07 恒玄科技(上海)有限公司 Audio data transmission method and double wireless headsets between a kind of pair of wireless headset
CN109215669A (en) * 2017-07-06 2019-01-15 中国电影科学技术研究所 Wireless sound box multi-channel synchronous system and method
WO2020107466A1 (en) * 2018-11-30 2020-06-04 华为技术有限公司 Point to multi-point data transmission method and device
CN109635133A (en) * 2018-12-18 2019-04-16 腾讯音乐娱乐科技(深圳)有限公司 Visualize audio frequency playing method, device, electronic equipment and storage medium
CN112165645A (en) * 2020-09-28 2021-01-01 北京小米松果电子有限公司 Control method of playback device, and computer storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115567086A (en) * 2022-09-09 2023-01-03 安克创新科技股份有限公司 Audio transmission device, audio playback device, and audio transmission and synchronization system
CN115567086B (en) * 2022-09-09 2024-03-26 安克创新科技股份有限公司 Audio transmission device, audio playing device and audio transmission and synchronization system

Also Published As

Publication number Publication date
CN113422997B (en) 2023-02-28

Similar Documents

Publication Publication Date Title
RU2648262C2 (en) Method and device for implementing multimedia data synchronization
CN112969096A (en) Media playing method and device and electronic equipment
CN111583952B (en) Audio processing method, device, electronic equipment and storage medium
CN104202614B (en) A kind of method of Network Environment adjustment video image quality and device
CN112130616B (en) Clock synchronization method, device and storage medium
US10362173B2 (en) Web real-time communication from an audiovisual file
CN105451056B (en) Audio and video synchronization method and device
CN104486645A (en) Method for determining program audience rating, playback equipment, server and device
CN110992920B (en) Live broadcasting chorus method and device, electronic equipment and storage medium
CN110996122B (en) Video frame transmission method, device, computer equipment and storage medium
CN112165645A (en) Control method of playback device, and computer storage medium
CN113422997B (en) Method and device for playing audio data and readable storage medium
US11908481B2 (en) Method for encoding live-streaming data and encoding device
CN112910592B (en) Clock synchronization method and device, terminal and storage medium
CN107710754B (en) Audio and video data synchronization method and device
CN111696552A (en) Translation method, translation device and earphone
CN111739538A (en) Translation method and device, earphone and server
CN117813652A (en) Audio signal encoding method, device, electronic equipment and storage medium
CN113660513A (en) Method, device and storage medium for synchronizing playing time
CN110166797B (en) Video transcoding method and device, electronic equipment and storage medium
CN114422840A (en) Audio track switching method and device
CN109920437B (en) Method and device for removing interference
CN113301254A (en) Video recording method, processing method, device, terminal and storage medium
CN104717516A (en) Method and device for transmitting multimedia data
CN101102510A (en) Audio and video synchronization method for portable image terminal

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