Skip to main content
skalamichal
Known Participant
March 13, 2013
Answered

Problem with sound playback in external SWF

  • March 13, 2013
  • 1 reply
  • 1737 views

Hello,

I need to load external SWF file, which contains simple image sequence + audio. I've used the MovieClipLoader class for this and also a preloader, where I'm checking if I can run the SWF safely, without the need to interrupt playback later and continue with loading. It's working similar to YouTube video, where the video is buffered.

The issue is that when I load the SWF and run it, the audio start to play later. I tested more cases and the reason is that even if I load enough from the SWF, I can be sure I can start playback, because it not enough loaded from the audio, so the it starts to play a bit later. When I load more, the audio starts to play immediately.

So the question is, is there a way how can I check if audio is loaded and ready to play?

Thanks,

Michal

This topic has been closed for replies.
Correct answer kglad

Unfortunatelly, this is not good solution, I don't know how many frames I need to load. If I know it, I don't have to ask on this forum

Sorry, there is probably no solution and I'll have to look at mp3 spec, SWF file spec and other things again.


if you can inspect the external swf's fla enough to know the sound's sync is set to stream you should be able to look at the timeline where the sound is attached and determine the number of frames the sound occupies.

1 reply

kglad
Community Expert
Community Expert
March 13, 2013

how is the external swf's sound created?

is there a sound file being loaded?  is there an flv being played in an flvplayback component?

skalamichal
Known Participant
March 13, 2013

The swf file is compiled in Java. It is a frame by frame animation (bunch of screenshots) + stream sound in mp3 format.

No other SWF is loaded at the time and I'm not using FLV in this case.

Michal

kglad
Community Expert
Community Expert
March 13, 2013

your sound is attached to a timeline?

if yes, then a correctly coded preloader will ensure the sound is loaded completely before the sound starts to play IF there is a stop on the external swf's first frame.