Audio and video playback system and method for playing audio data applied thereto
First Claim
1. A method for playing audio data, the method applied to an audio and video playback system, the audio and video playback system comprising a secondary audio device and an audio and video playback device having a local audio device, wherein the audio and video playback device plays both audio and video, the method comprising:
- allocating a local audio buffer space and a secondary audio buffer space to the local audio device and the secondary audio device, respectively;
processing obtained multimedia data to generate local audio data and secondary audio data;
writing the local audio data and the secondary audio data to the local audio buffer space and the secondary audio buffer space, respectively, wherein the local audio data and the secondary audio data are not the same;
reading the local audio data and the secondary audio data buffered in the local audio buffer space and the secondary audio buffer space to the local audio device and the secondary audio device, respectively, to have the local audio device and the secondary audio device simultaneously play the local audio data and the secondary audio data, respectively,wherein the local audio buffer space and the secondary audio buffer space are each a ring buffer space, such that while the local audio data and the secondary audio data buffered in the local audio buffer space and the secondary audio buffer space are read to the local audio device and the secondary audio device, the local audio data and the secondary audio data are continuously further written to the local audio buffer space and the secondary audio buffer space, respectively; and
determining whether the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous;
when it is determined that the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are asynchronous, executing a synchronization mechanism to synchronize the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous;
wherein the step of determining whether the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous further comprises;
acquiring delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device, respectively; and
determining, according to the respective delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device, whether the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous;
wherein the step of executing the synchronization mechanism to synchronize the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device further comprises;
determining a difference between the delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device;
generating a null packet having a corresponding size according to the difference between the delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device; and
writing the null packet to the local audio buffer space or the secondary audio buffer space corresponding to the local audio device or the secondary audio device having the smaller delay period, to cause the local audio device or the secondary audio device to output the null packet when outputting the local audio data or the secondary audio data, thereby synchronizing the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device.
2 Assignments
0 Petitions
Accused Products
Abstract
An audio and video playback system includes an audio and video playback device having a local audio device, and a secondary audio device. A method for playing audio data includes: allocating a local audio buffer space and a secondary audio buffer space to the local audio device and the secondary audio device, respectively; processing obtained multimedia data to generate local audio data and secondary audio data; writing the local audio data and the secondary audio data to the local audio buffer space and the secondary audio buffer space, respectively; reading the local audio data and the secondary audio data buffered in the local audio buffer space and the secondary audio buffer space to the local audio device and the secondary audio device, to have the local audio device and the secondary audio device play the local audio data and the secondary audio data, respectively.
16 Citations
11 Claims
-
1. A method for playing audio data, the method applied to an audio and video playback system, the audio and video playback system comprising a secondary audio device and an audio and video playback device having a local audio device, wherein the audio and video playback device plays both audio and video, the method comprising:
-
allocating a local audio buffer space and a secondary audio buffer space to the local audio device and the secondary audio device, respectively; processing obtained multimedia data to generate local audio data and secondary audio data; writing the local audio data and the secondary audio data to the local audio buffer space and the secondary audio buffer space, respectively, wherein the local audio data and the secondary audio data are not the same; reading the local audio data and the secondary audio data buffered in the local audio buffer space and the secondary audio buffer space to the local audio device and the secondary audio device, respectively, to have the local audio device and the secondary audio device simultaneously play the local audio data and the secondary audio data, respectively, wherein the local audio buffer space and the secondary audio buffer space are each a ring buffer space, such that while the local audio data and the secondary audio data buffered in the local audio buffer space and the secondary audio buffer space are read to the local audio device and the secondary audio device, the local audio data and the secondary audio data are continuously further written to the local audio buffer space and the secondary audio buffer space, respectively; and determining whether the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous; when it is determined that the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are asynchronous, executing a synchronization mechanism to synchronize the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous; wherein the step of determining whether the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous further comprises; acquiring delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device, respectively; and determining, according to the respective delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device, whether the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous; wherein the step of executing the synchronization mechanism to synchronize the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device further comprises; determining a difference between the delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device; generating a null packet having a corresponding size according to the difference between the delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device; and writing the null packet to the local audio buffer space or the secondary audio buffer space corresponding to the local audio device or the secondary audio device having the smaller delay period, to cause the local audio device or the secondary audio device to output the null packet when outputting the local audio data or the secondary audio data, thereby synchronizing the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device. - View Dependent Claims (2, 5, 6)
-
-
3. A method for playing audio data, the method applied to an audio and video playback system, the audio and video playback system comprising a secondary audio device and an audio and video playback device having a local audio device, wherein the audio and video playback device plays both audio and video, the method comprising:
-
allocating a local audio buffer space and a secondary audio buffer space to the local audio device and the secondary audio device, respectively; processing obtained multimedia data to generate local audio data and secondary audio data; writing the local audio data and the secondary audio data to the local audio buffer space and the secondary audio buffer space, respectively, wherein the local audio data and the secondary audio data are not the same; reading the local audio data and the secondary audio data buffered in the local audio buffer space and the secondary audio buffer space to the local audio device and the secondary audio device, respectively, to have the local audio device and the secondary audio device simultaneously play the local audio data and the secondary audio data, respectively; wherein the local audio buffer space and the secondary audio buffer space are each a ring buffer space, such that while the local audio data and the secondary audio data buffered in the local audio buffer space and the secondary audio buffer space are read to the local audio device and the secondary audio device, the local audio data and the secondary audio data are continuously further written to the local audio buffer space and the secondary audio buffer space, respectively; and determining whether the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous; when it is determined that the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are asynchronous, executing a synchronization mechanism to synchronize the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous; wherein the step of determining whether the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous further comprises; acquiring delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device, respectively; and determining, according to the respective delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device, whether the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous, wherein the step of executing the synchronization mechanism to synchronize the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device further comprises; determining a difference between the delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device; obtaining a corresponding data size according to the difference between the delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device; and discarding data having the corresponding data size from the local audio buffer space or the secondary audio buffer space corresponding to the local audio device or the secondary audio device having the greater delay period, thereby synchronizing the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device. - View Dependent Claims (4)
-
-
7. An audio and video playback system, comprising:
-
an audio and video playback device, for playing multimedia data, the audio and video playback device comprising a local audio device, a processor, a memory and a buffer unit, wherein the audio and video playback device plays both audio and video; and a secondary audio device, connected to the audio and video playback device;
wherein the processor in the audio and video playback device performs steps of;allocating a local audio buffer space and a secondary audio buffer space to the local audio device and the secondary audio device, respectively; processing the obtained multimedia data to generate local audio data and secondary audio data; writing the local audio data and the secondary audio data to the local audio buffer space and the secondary audio buffer space, respectively; and reading the local audio data and the secondary audio data buffered in the local audio buffer space and the secondary audio buffer space to the local audio device and the secondary audio device, respectively, to have the local audio device and the secondary audio device simultaneously play the local audio data and the secondary audio data, respectively; wherein, an audio device management program is stored in the memory of the audio and video playback device; when the audio device management program is executed, the audio and video playback device controls the local audio device and the secondary audio device according to the audio device management program to perform a collaborated playback task to play audio data in the multimedia data; wherein when the audio and video playback device controls the local audio device and the secondary audio device according to the audio device management program to perform the collaborated playback task to play audio data in the multimedia data; wherein the local audio buffer space and the secondary audio buffer space are each a ring buffer space, such that while the local audio data and the secondary audio data buffered in the local audio buffer space and the secondary audio buffer space are read to the local audio device and the secondary audio device, the local audio data and the secondary audio data are continuously further written to the local audio buffer space and the secondary audio buffer space, respectively; wherein when the audio and video playback controls the local audio device and the secondary audio device to collaboratively play the audio data in the multimedia data, the processor further performs steps of; determining whether the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous; when it is determined that the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are asynchronous, executing a synchronization mechanism to synchronize the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous; wherein the step of determining whether the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous further comprises; acquiring delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device, respectively; and determining, according to the respective delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device, whether the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous; wherein the step of the step of executing the synchronization mechanism to synchronize the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device further comprises; determining a difference between the delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device; generating a null packet having a corresponding size according to the difference between the delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device; and writing the null packet to the local audio buffer space or the secondary audio buffer space corresponding to the local audio device or the secondary audio device having the smaller delay period, to cause the local audio device or the secondary audio device to output the null packet when outputting the local audio data or the secondary audio data, thereby synchronizing the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device. - View Dependent Claims (9, 10, 11)
-
-
8. An audio and video playback system, comprising:
-
an audio and video playback device, for playing multimedia data, the audio and video playback device comprising a local audio device, a processor, a memory and a buffer unit, wherein the audio and video playback device plays both audio and video; and a secondary audio device, connected to the audio and video playback device;
wherein the processor in the audio and video playback device performs steps of;allocating a local audio buffer space and a secondary audio buffer space to the local audio device and the secondary audio device, respectively; processing the obtained multimedia data to generate local audio data and secondary audio data; writing the local audio data and the secondary audio data to the local audio buffer space and the secondary audio buffer space, respectively; and reading the local audio data and the secondary audio data buffered in the local audio buffer space and the secondary audio buffer space to the local audio device and the secondary audio device, respectively, to have the local audio device and the secondary audio device simultaneously play the local audio data and the secondary audio data, respectively; wherein, an audio device management program is stored in the memory of the audio and video playback device; when the audio device management program is executed, the audio and video playback device controls the local audio device and the secondary audio device according to the audio device management program to perform a collaborated playback task to play audio data in the multimedia data; wherein when the audio and video playback device controls the local audio device and the secondary audio device according to the audio device management program to perform the collaborated playback task to play audio data in the multimedia data; wherein the local audio buffer space and the secondary audio buffer space are each a ring buffer space, such that while the local audio data and the secondary audio data buffered in the local audio buffer space and the secondary audio buffer space are read to the local audio device and the secondary audio device, the local audio data and the secondary audio data are continuously further written to the local audio buffer space and the secondary audio buffer space, respectively; wherein when the audio and video playback controls the local audio device and the secondary audio device to collaboratively play the audio data in the multimedia data, the processor further performs steps of; determining whether the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous; when it is determined that the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are asynchronous, executing a synchronization mechanism to synchronize the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous; wherein the step of determining whether the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous further comprises; acquiring delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device, respectively; and determining, according to the respective delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device, whether the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device are synchronous; wherein the step of executing the synchronization mechanism to synchronize the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device further comprises; determining a difference between the delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device; obtaining the corresponding data size according to the difference between the delay periods of the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device; and discarding data having the corresponding data size from the local audio buffer space or the secondary audio buffer space corresponding to the local audio device or the secondary audio device having the greater delay period, thereby synchronizing the local audio data and the secondary audio data outputted from the local audio device and the secondary audio device.
-
Specification