Skip to main content
May 6, 2007
Question

Synchronization of Multiple Audio Streams

  • May 6, 2007
  • 1 reply
  • 444 views
Hi,

I'm trying to synchronize several Audio streams during playback and recording. Several questions I have and not sure if actually feasible or how to best address :
1/ When playing back 2 audio streams, how can I ensure the playback is full synchronized (<20ms difference) when client receives the 2 streams in playback ? Basically trying to simulate a mix-down with 2 // streaming. Ultimately wants to achieve this with about 5 audio streams playing back and can't accept tolerate delay. I suspect I need to synchronize the start of each stream so that they all start together, but not been very succesfull so far. Alternatively is there a way to mix-down 2 streams on server and send back a 1 mixed-down audio stream ?

2/ More tricky I believe : If I playback 1 audio stream and start recording a separate audio stream, I'm getting again desynchronised. Later If I replay the 1 audio and the newly recorded one, both are not anymore aligned. I suspect (but not sure that the delay and desynchronization is introduced during the recording but not sure and reason I asked first question...

If someone knows those answers or could provide some direction of work.... I would greatly appreciate.

Thanks
    This topic is closed to new replies. Start a new post to keep the conversation going.

    1 reply

    May 6, 2007
    When it comes to FMS streams, there really is no way of accurately syncronizing streams. Since you can't keep data in buffer when pausing the stream, and you have to rebuffer any time you seek, it's impossible.

    The only way I've been able to sync flv's is using progressive download. With progressive, you can sync streams, but the accuracy is limited to the keyframe interval of the flv files. For example, if you have 2 keyframes per second, you can achieve sync with 1 second accuracy. with 4 keyframes per second, you can get the offset down to 500ms. If you make every frame a keyframe (makes for a huge file), you can get frame accurate sync.

    The theory is to build a class that monitors the time and buffer length properties of your two streams, pausing and/or seeking when needed to maintain sync.