HTML5 Canvas ,Sound Synchronization,How to Achieve
HTML5 Canvas ,Sound
How sound is synchronized like AS3。
Need to add sound,
sound and picture Sync

HTML5 Canvas ,Sound
How sound is synchronized like AS3。
Need to add sound,
sound and picture Sync

If you're doing the frame skipping code you could get cases where the frame that a sound was started on gets skipped. You can solve that by setting up a timeout at the start of the animation. If in your case you had a 12 frames per second animation, you could have this in the first frame:
createjs.Sound.play("au");
setTimeout(play2,2000);
setTimeout(play3,5000);
function play2(){
createjs.Sound.play("6th");
}
function play3(){
createjs.Sound.play("13th");
}
And have no sounds in the timeline. Each sound would be told to play after the right amount of time.
It would be possible to set up a function that takes parameters, and only have one function that actually plays the sound, but it's not worth the effort to do that just to save a few lines of code.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.