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();
}
}
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…
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.