PDA

View Full Version : looping sounds seamlessly..



filipo
February 14th, 2005, 12:37 AM
Hey. I'm stuck and I have a deadline for this project soon.

So I got a loop that I'm loading into Flash with the Sound object. The sound loads good and it starts playing but when it loops back to the beginning there's some silence and then it loops again. The sound loops fine in a sound editing program, the only problem is that Flash leaves a gap when its going to start again.

Anyone has come up with a solution to make a sound loop seamlessly?


this is my code:

loadMusic = function() {
loop = new Sound();
loop.loadSound("lomtrack.mp3", false);
}
loadMusic();

playMusic = function() {
loop.start(0, 100);
}

playmusic();

tofuisonmyside
February 14th, 2005, 02:55 AM
hi filipo, i don't think it's flash, because any loop from flashkit ain't get this pb

in the sound program are you 100% sure there is no little gap between end and beginning ?

el endemoniau
February 14th, 2005, 08:44 AM
I had the same problem trying to loop...the mp3 file (dinamically or embedded loaded) sounds with a silence at the end of the loop (i guess a Flash trouble). So i decided to loop embbeded wav that play normal, without silence.
But with this appears another problem: embedded wav make "heavier" the load process, and then the need to preload an external swf that contains the loops.Otherwise the preloader maybe show progress at 30%, 50%, etc.,because the need to import embbeded wavs at first frame.

check this soundbar, is what i made to make loops and preloader play right:

http://www20.brinkster.com/endemoniau/pablin/

i made the entire soundbar and controls in an external SWF and then loaded into the main movie.

(sorry if a don't be clear....i do my best):whistle:

filipo
February 14th, 2005, 11:24 AM
I'm thinking of importing the sound into the library and using AttachSound.

I'm sure there's no gap at the end of the loop cos it sounds perfect in a music program.

thanks for your replies.

eki
February 15th, 2005, 12:15 PM
try:


loadMusic = function() {
loop = new Sound();
loop.loadSound("lomtrack.mp3", false);
}
loadMusic();

playMusic = function() {
loop.start();

}
loop.onSoundComplete = function(){
playMusic ();
}

playmusic();


SHO