Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-24-2004, 09:31 AM   #1
Join Date: Apr 2003
Location: France
Posts: 77
Default looping several sounds... a gap between the sounds


I planned to use several loops in a presentation, and queue them so it will sound like a longer piece of music.

I planned to use onSoundComplete with the following basic behavior :

ActionScript Code:
snd1 = new Sound(this); snd1.attachSound("loop1"); snd2 = new Sound(this); snd2.attachSound("loop2"); snd1.onSoundComplete = function() {     snd2.start(); } snd1.start();

The same principle has been suggested several times on this forum, like here :

But it doesn't work fine for me : there's a gap between the two sounds when I do so, a brief silence that cuts the music flow.

So I am considering using the setInterval function instead, something like this :

ActionScript Code:
att = setInterval(function() {     clearInterval(att);     snd2.start(); }, snd1.duration-150);

which works, but I'm not found of it. Plus notice that I have to set the callback 150 milliseconds shorter than the snd1 duration in order to loop fine, otherwise it doesn't loop well.

So you're gonna tell me : there is something wrong with my loop files. Nope, if I make them one file, pasting the second sound at the end of the first, it works fine.

Please, does anyone has a solution ?

_marabout_ is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 01:44 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.