Skip to main content
Participant
May 26, 2011
Question

Track audio and video buffering.

  • May 26, 2011
  • 3 replies
  • 552 views

Hello,

I'm working on the development of a tool that plays two audio files and one video file simutaneously.

All the files need to play together at the exact same time, so that the audio syncs with the video.

Our situation right now is that each one of the files start playing at different times depending on how fast they are loading.

The problem is, my programmer is telling me that there is no way to track the buffer of the audio, so for example, the video only starts playing when at least 30% of the audio is loaded. Is it possible to do this?

The video player would then display something like:

Audio 1 loading - 23%
Audio 2 loading  -14%

Video    loading  -56%

The video only start playing when both audios are at 30% for example.

This is what I need, can anyone shed any light for me? Thanks!

This topic has been closed for replies.

3 replies

avitorioAuthor
Participant
May 30, 2011

I understand that client side hardware and other things might interefere with the synching of the audios and video.

This influences the final performance of the tool but it's not really what I am concerned about, what I need now is to know if it is possible to track the buffer state of the files. So that we can display a message like: "Files loading" and the files will only play when they reach 30% of loading.

The synching is pretty good, the only problem is that files are starting to play at different times due to buffering, if they are already loaded they play perfectly.

So, is it possible to achieve this? I mean, can I make for example, the video file only play once the two audio files are at least 30% ready?

Any help would be highly appreciated!

Thank you!

Inspiring
May 30, 2011

Sound buffer is no as straightforward as with NetStream  - one can use SoundLoaderContext in conjunction with isBuffering. Here is documentation:

http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/media/SoundLoaderContext.html

Or one can read bytestLoaded vs byteTotal and start playing when certain amount of data is loaded.

relaxatraja
Inspiring
May 27, 2011

Do not Synching the different audio and video at the runtime. Most of the elearning projects are synching by embeding the video in the timeline and the sound in the different layer to sync to the video by extending the frames and all.

Inspiring
May 26, 2011

If you load files at runtime - it is extremely difficult if not impossible to achieve perfect synchronization. There are many reasons for that including client side hardware (GPU, Sound Card, etc) and amount of code that is executed per unit of time. This is true even if you load entire files. This means that no matter how files are buffered, still you will observe problems.

The only more or less reliable way to synch media is to place all of it on the same timeline.