Re: [Flashcoders] Flash adds seconds to audio clip
Thanx James, I've been too busy to devote a lot of undivided time on this matter...I'm still new at incorporating flash and media. Could you explain the Sync method and how to set it to "Event" or "Stream"? - Frank On 1/3/07, JOR <[EMAIL PROTECTED]> wrote: If I understood your question correctly, it sounds like you've attached a sound to a keyframe. The sound plays and when it reaches a certain frame you're expecting the sound to have finished because (12fps * sound ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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
Re: [Flashcoders] Flash adds seconds to audio clip
If I understood your question correctly, it sounds like you've attached a sound to a keyframe. The sound plays and when it reaches a certain frame you're expecting the sound to have finished because (12fps * sound length) is your expected ending frame. If you are using a Sync method of "Event", this almost certainly will not be the case and results will vary from machine to machine the SWF is played on because the sound and timeline are independent from each other. The longer the audio, the larger the discrepancy. If you choose "Stream" as the Sync method, it will marry the sound to the timeline and you can guarantee that your expected frame will hit at the right time. James O'Reilly — Consultant Adobe Certified Flash Expert http://www.jamesor.com Design • Code • Train Frank Dewey wrote: Hello all, When I play a 30 second audio file in Flash (.wav or .mp3), it is taking flash 32 seconds to run it. To test this, I've made it real simple and only used one layer (The frame rate for the audio is 12 fps). The audio starts on the first frame and lasts until the 361st (30 seconds x 12 fps + 1) frame. I've added this code to these frames: var tmp = new Date(); trace("start time: " + tmp.getSeconds()); On the 362nd frame (immediately after the audio has played) I have another key frame with this code: var tmp = new Date(); trace("end time: " + tmp.getSeconds()); That's it. I just output the time when the movie starts and when it stops. When I only use 338 frames (instead of 361), then the whole clips pays fine and lasts 30 seconds. Why is a 30 second clip (running at 12 fps) only taking 28.1 seconds to play? Thank you - Frank ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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
Re: [Flashcoders] Flash adds seconds to audio clip
Hi Frank, Not sure why it's an issue for you, so I'm not sure what to suggest. If you still want to test the length of the audio clip, use SoundObject to load it and then use SoundObject's onComplete method to tell you when the sound is done. But the bigger question is, why is this a problem? As I mentioned, if the sound is musical, you'd almost certainly hear a change in pitch if the speed were off by one or two percent. Marc At 08:40 AM 12/29/2006, you wrote: Thanx Marc, I don't have a stopwatch...but I did use windows media player and when I put a 'finish' text box on the 362nd frame, then it doesn't appear until approximately 2 seconds after the audio has finished playing. In one way it seems like a bug since the frame after the audio clip is not being executed until 2 seconds later than it should. But it maybe, like you said, the audio clip is eating up so many resources that Flash won't even show the 'finish' text box until 2 seconds after it should. It does fine with .avi video files though...it is just .wav and .mp3 files that are giving me troubles. Any other suggestions? thanx - Frank On 12/28/06, Marc Hoffman <[EMAIL PROTECTED]> wrote: From your description, it's not clear if the trace output is 32 seconds or 28.1 seconds. But either way, if the sound were being slowed down or sped up that much, you would likely hear a difference in pitch (especially if it's music). Try timing the audio with a stopwatch. I'm guessing it's the trace call that's being delayed due to the sound processing, and that the sound is being played correctly. Marc Hoffman At 12:30 PM 12/28/2006, you wrote: >Hello all, > >When I play a 30 second audio file in Flash (.wav or .mp3), it is >taking flash 32 seconds to run it. > > >To test this, I've made it real simple and only used one layer (The >frame rate for the audio is 12 fps). The audio starts on the first >frame and lasts until the 361st (30 seconds x 12 fps + 1) frame. I've >added this code to these frames: > >var tmp = new Date(); >trace("start time: " + tmp.getSeconds()); > >On the 362nd frame (immediately after the audio has played) I have >another key frame with this code: > >var tmp = new Date(); >trace("end time: " + tmp.getSeconds()); > > >That's it. I just output the time when the movie starts and when it >stops. When I only use 338 frames (instead of 361), then the whole >clips pays fine and lasts 30 seconds. > > >Why is a 30 second clip (running at 12 fps) only taking 28.1 seconds to play? > >Thank you - > Frank >___ >Flashcoders@chattyfig.figleaf.com >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 > ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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
Re: [Flashcoders] Flash adds seconds to audio clip
Thanx Marc, I don't have a stopwatch...but I did use windows media player and when I put a 'finish' text box on the 362nd frame, then it doesn't appear until approximately 2 seconds after the audio has finished playing. In one way it seems like a bug since the frame after the audio clip is not being executed until 2 seconds later than it should. But it maybe, like you said, the audio clip is eating up so many resources that Flash won't even show the 'finish' text box until 2 seconds after it should. It does fine with .avi video files though...it is just .wav and .mp3 files that are giving me troubles. Any other suggestions? thanx - Frank On 12/28/06, Marc Hoffman <[EMAIL PROTECTED]> wrote: From your description, it's not clear if the trace output is 32 seconds or 28.1 seconds. But either way, if the sound were being slowed down or sped up that much, you would likely hear a difference in pitch (especially if it's music). Try timing the audio with a stopwatch. I'm guessing it's the trace call that's being delayed due to the sound processing, and that the sound is being played correctly. Marc Hoffman At 12:30 PM 12/28/2006, you wrote: >Hello all, > >When I play a 30 second audio file in Flash (.wav or .mp3), it is >taking flash 32 seconds to run it. > > >To test this, I've made it real simple and only used one layer (The >frame rate for the audio is 12 fps). The audio starts on the first >frame and lasts until the 361st (30 seconds x 12 fps + 1) frame. I've >added this code to these frames: > >var tmp = new Date(); >trace("start time: " + tmp.getSeconds()); > >On the 362nd frame (immediately after the audio has played) I have >another key frame with this code: > >var tmp = new Date(); >trace("end time: " + tmp.getSeconds()); > > >That's it. I just output the time when the movie starts and when it >stops. When I only use 338 frames (instead of 361), then the whole >clips pays fine and lasts 30 seconds. > > >Why is a 30 second clip (running at 12 fps) only taking 28.1 seconds to play? > >Thank you - > Frank >___ >Flashcoders@chattyfig.figleaf.com >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 > ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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
Re: [Flashcoders] Flash adds seconds to audio clip
From your description, it's not clear if the trace output is 32 seconds or 28.1 seconds. But either way, if the sound were being slowed down or sped up that much, you would likely hear a difference in pitch (especially if it's music). Try timing the audio with a stopwatch. I'm guessing it's the trace call that's being delayed due to the sound processing, and that the sound is being played correctly. Marc Hoffman At 12:30 PM 12/28/2006, you wrote: Hello all, When I play a 30 second audio file in Flash (.wav or .mp3), it is taking flash 32 seconds to run it. To test this, I've made it real simple and only used one layer (The frame rate for the audio is 12 fps). The audio starts on the first frame and lasts until the 361st (30 seconds x 12 fps + 1) frame. I've added this code to these frames: var tmp = new Date(); trace("start time: " + tmp.getSeconds()); On the 362nd frame (immediately after the audio has played) I have another key frame with this code: var tmp = new Date(); trace("end time: " + tmp.getSeconds()); That's it. I just output the time when the movie starts and when it stops. When I only use 338 frames (instead of 361), then the whole clips pays fine and lasts 30 seconds. Why is a 30 second clip (running at 12 fps) only taking 28.1 seconds to play? Thank you - Frank ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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
[Flashcoders] Flash adds seconds to audio clip
Hello all, When I play a 30 second audio file in Flash (.wav or .mp3), it is taking flash 32 seconds to run it. To test this, I've made it real simple and only used one layer (The frame rate for the audio is 12 fps). The audio starts on the first frame and lasts until the 361st (30 seconds x 12 fps + 1) frame. I've added this code to these frames: var tmp = new Date(); trace("start time: " + tmp.getSeconds()); On the 362nd frame (immediately after the audio has played) I have another key frame with this code: var tmp = new Date(); trace("end time: " + tmp.getSeconds()); That's it. I just output the time when the movie starts and when it stops. When I only use 338 frames (instead of 361), then the whole clips pays fine and lasts 30 seconds. Why is a 30 second clip (running at 12 fps) only taking 28.1 seconds to play? Thank you - Frank ___ Flashcoders@chattyfig.figleaf.com 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