Jeff,

Why does it need to be exact? If you're trying to synchronize different sounds or have them loop seamlessly, a frame-based approach will never work.

I suspect your problem is related to the buffering that Flash does of all sound. You could play with the soundBuffTime (that may not be exactly what it's called in AS). But most devs I know always allow a few frames of playback before placing a sound in the timeline. I've just followed that practice since Flash 4 and never had a problem. If you need it to start precisely with the playhead, you should look into the sound object: create the Sound object, load the sound into it, test for a certain amount to be buffered, and then use AS to start the sound and the playhead at the same time. So look into properties of the Sound object.

Marc

At 09:26 PM 7/6/2006, you wrote:
I'm trying to understand why the Flash player isn't playing my audio
properly.  It's muting output during the first frame.  I need to fix
that.

It also mutes output during the frame after an ActionGotoFrame.  I
also need to fix that.

I'm using Flash 8 on Mac OS X 10.4.7; other testers report the same
problem on other hosts.

I have a simple SWF which contains just streaming audio formatted as
a single SoundStream.  I created the file using an application that I
wrote.  I've followed the SWF spec closely and I'm very confident
that the file format is correct.  (It's certainly more correct than
files generated by ffmpeg and similar.)

Here's a brief dump of the file.  (Note that this file uses a
framerate of 1 frame/sec to make the problem really obvious.)

Header: FWS version 4
        File length: 480712
        RECT: (xMin=0, xMax=6400, yMin=0, yMax=4000)
        Frames/second: 1.00
        Total frames: 31
SoundStreamHead2 (playbackSoundRate=3, playbackSoundType=1,
streamSoundCompression=2, streamSoundRate=3, streamSoundType=1,
StreamSoundSampleCount=44100, latencySeek=0)
SoundStreamBlock containing [Mp3SoundStreamData record;
sampleCount=43776 containing [Mp3SoundData record; seekSamples=0]]
----------  ShowFrame  ----------
SoundStreamBlock containing [Mp3SoundStreamData record;
sampleCount=43776 containing [Mp3SoundData record; seekSamples=324]]
----------  ShowFrame  ----------
SoundStreamBlock containing [Mp3SoundStreamData record;
sampleCount=43776 containing [Mp3SoundData record; seekSamples=648]]
----------  ShowFrame  ----------
SoundStreamBlock containing [Mp3SoundStreamData record;
sampleCount=44928 containing [Mp3SoundData record; seekSamples=972]]
----------  ShowFrame  ----------
SoundStreamBlock containing [Mp3SoundStreamData record;
sampleCount=43776 containing [Mp3SoundData record; seekSamples=144]]
... more like this ...

The problem is that the Flash player doesn't start playback with the
first frame.  Instead, it mutes the output during the first frame,
then begins emitting sound with the second frame.

I suspect that this is a defect in all Flash players; I believe that
the player mutes the sound during the first frame after a Play or
ActionGotoFrame.  I suppose that many people don't care -- what's the
loss of an audio frame here and there?  But it matters in my
application because the output must be perfect.

Do you have any suggestions for resolving the problem?  I'm
especially interested in fixing the problem where audio is muted
after an ActionGotoFrame.  That's a killer.

thx!

-jeff stearns

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to