View Full Version : Sound causing frames to lag
staind25
08-07-2008, 12:44 AM
Hey, this is my first time using the board so I apologize if this question has already been answered (I looked around a bit).
I've tested my Flash several times inside Flash and it works JUST FINE...but just for laughs I published it and tested it...and the frames lag but the sound doesn't, causing the sound and frames to not sync up properly.
When I made this, I was only aware of being able to add sound by using ActionScript (Was thinking about posting in the AS forum but didn't think it fit into just that), which is what I did. Now I'm aware that you can also set up a sound on its own layer and use the drop down menu to play it and whatnot... I tried that and it didn't sync properly which would make me spend an hour readjusting everything (I'm 330 frames into the animation)...
What I really need to know is...the way I'm doing the sound...is that not a good way to do it? I'd much rather do it this way and be able to fix the lag issue...does anybody know what I'm talking about?
And if I should do it the other way, please explain to me why that way is better than this way, and what the difference is, using any and all detail you can give me...I'm eager to learn.
Also I should say this is only my second project...it's a huge undertaking for my second project but I'm doing very well and want to keep going...but I figured you should know that to understand that I'm still something of a noob at Flash.
If you need more detail / examples before you can help me, please, let me know...I'd be glad to provide you with whatever you need.
I appreciate any help you can give me...thank you in advance.
atomic
08-07-2008, 02:27 AM
The one and only way to maintain, as much as possible, a tight sync between the audio and video portions of your Flash movie, is to use a timeline sound with it's Sync set to "stream"...
The player is then forced to try and maintain the set framerate, and will even drop video frames, if it needs to, to try and maintain that sync...
http://www.adobe.com/support/flash/how/expert/sound/sound07.html
staind25
08-07-2008, 04:00 AM
Thanks much...
But I am curious...why is it even possible to play sound through ActionScript if it's the seemingly "wrong" way of doing so?
atomic
08-07-2008, 04:05 AM
Grrrrrreat! ;)
Nobody said it was wrong to use soundObjects, only that when the main concern is a relatively tight sync between audio & video, the easiest and better way is to use a stream timeline sound...
That said, I've done it with some flv player (only playing audio) and cue points triggering actionscripted tweens... And it worked nicely in that project, although it was indeed much more work, and also that movie couldn't really be paused and re-started from the pausing point, which is possible with a stream timeline sound & timeline tweens.
staind25
08-07-2008, 06:13 AM
Well...maybe you can tell me what would be the best idea for what I'm doing.
Is what I'm doing is I have a guitarist playing a song...the song is the sound in the background. It's zoomed in on the guitar so you can see the guitarist's hands playing the ACTUAL NOTES to the song...
Obviously for this I don't need to pause it or anything. What I've done is just had it start somewhere, then very carefully set up the frames so that it synced up with the sound (Lots of math involved there :D)...
atomic
08-07-2008, 06:21 AM
I'm confused!
Wasn't the sound recorded with picture? Or are you trying to sync up your guitarist's actual sound & hand moves to a similar previously recorded sound track, like from a CD or something?
staind25
08-07-2008, 10:57 PM
Hehe, apologies.
The latter. I have a song playing in the background that I got from a CD. I'm matching the drawn guitarist's moves with the song playing. I have it synced perfectly in Flash, but when I publish it, the animation lags but the sound goes at the normal speed, causing it to not only look terrible but also not sync up.
atomic
08-08-2008, 01:09 AM
Still confused... But I'll repeat it. The one and only way to maintain some relative tight sync between audio and video, is to set the sound's Sync to stream, from the beginning of your project, and build your video from there...
staind25
08-08-2008, 01:54 AM
Okay...I'm still pretty lost, but you've been by far the most helpful and most responsive between this forum and the Newgrounds forum. Thank you very much.
atomic
08-08-2008, 02:18 AM
Grrrrrrrrreat! ;)
Sorry I couldn't be more helpful!
Scotlad
08-08-2008, 03:50 PM
atomic is right, the quickest failsafe way is use the sync to stream option to keep it locked down.. otherwise u could do what he mentioned and create cuepoints along the audio file, where each note is hit, and tell flash to jump to the appropriate frame on the timeline for each cuepoint.. more work but itd maybe actually be easier than trying to animate the fingers accurately by looking/scrubbing along the waveform on the timeline..
staind25
08-08-2008, 09:53 PM
Okay...I have one more question if you don't mind...
I tried the whole Stream thing, and it works when I publish it. However, it requires a lot of adjusting to get it to sync exactly because I was syncing it a different way. I'm thinking I should just keep going with how I had it until I'm DONE, and THEN take out the actionscript and set the sync to stream and adjust from there...because honestly, I don't know how to build off of what I have with the stream because I was doing it differently before. Is this a good idea?
staind25
08-08-2008, 09:58 PM
To eliminate any confusion as to what I am trying to do, I uploaded what I have so far as examples...maybe this'll paint a clearer picture of what I should be doing.
Here's the example where I used ActionScript to run the sound...no timeline event.
http://www.freewebs.com/staind2523/Guitar.swf
Here's where I took out the ActionScript, added the Sound layer, and set sync to stream, and made minor adjustments.
http://www.freewebs.com/staind2523/Guitar2.swf
Obviously the second works a little better but still needs A LOT of adjusting.
atomic
08-08-2008, 10:07 PM
I don't know what you did, but both links point back to this thread! :eek:
staind25
08-09-2008, 12:53 AM
Huh, that IS odd...I tested them right after I posted the message, but now I do it again, and you're right. Weird.
Oh well...if you're willing to just highlight the link, copy, and paste it into your address bar...that'll work.
staind25
08-09-2008, 09:46 PM
Err...anyone mind checking this out? I'm anxious to start working on the project again but don't want to start until I know which path to choose.
atomic
08-10-2008, 02:50 AM
I vote for the second method, no doubts!
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.