×

Audio and video playback system and method for playing audio data applied thereto

  • US 10,992,451 B2
  • Filed: 11/05/2018
  • Issued: 04/27/2021
  • Est. Priority Date: 12/01/2017
  • Status: Active Grant
First Claim
Patent Images

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 all claims
  • 2 Assignments
Timeline View
Assignment View
    ×
    ×