PDA

View Full Version : Looping audio without a pop



rrh
June 3rd, 2008, 12:31 PM
I have an audio clip that will loop fine when I play it in Audition, but when I try to loop it in Flash, it keeps doing a "pop" sound when it repeats.

Right now I'm using this to play it and loop:


public function playMe():void {
channel = snd.play();
channel.addEventListener(Event.SOUND_COMPLETE, loopMusic);
}

public function loopMusic(e:Event):void
{
if (channel != null)
{
channel.removeEventListener(Event.SOUND_COMPLETE, loopMusic);
playMe();
}
}

It's based on this guy's example.
http://doogog.com/music-looping-in-as3.html

Is there something I can do to avoid that popping when it loops?

bpalermo
June 3rd, 2008, 12:36 PM
Are you sure the "pop" isn't in the sound file? Sometimes audio clips have a short silence in the beginning or end, that need to be trimmed before looping them. Use a sound edition software to make sure it's not in the sound. Besides that, I have never seem this problem in Flash. :) I hope it helps...

rrh
June 3rd, 2008, 01:44 PM
That's why I said it loops fine in Audition. If there was a gap in the file, then wouldn't I hear a pop when I play it in Audition?

quicksmack
June 13th, 2008, 04:54 PM
are you sure you cut the audio in the zero-crossing (the wave that intersects with the 0db line)?

not doing so will often make a pop sound when looped..

misterooga
June 26th, 2008, 07:53 AM
If you convert the audio file to 'wave' format and crack it open on a wave editor you might see it.

I also had a similar incident in my game. The mp3 players I was using for test prior to inserting music into Flash were 'smart' enough to skip first couple seconds of the file, thus I never heard those crackles and pops.

It really annoyed me that I ended up asking my sound guy to check again and sure enough, he found some noise in the very beginning and at the very end, which are fine if you play the music once but becomes a nightmare when you loop them through.

darksonxd
July 8th, 2008, 09:31 PM
how can i avoid the "pause" between each iteration of the sound?
i'm using an external MP3 to play the loop, but i've tried several methods and so far, none has done the job...
they indeed loop the sound...but there's a pause at the end of the sound...and the loop cut is noticeable.

any idea how to fix it?