This might work to achieve gapless looping:

Once you've loaded the audio assets (an mp3 file, swf file library assets,
etc.), copy the raw sound data into a ByteArray.  Then to play it back you
create a duplicate of that ByteArray and feed it to a new Sound object when
it throws it's SampleDataEvent event.  Once you've used up the ByteArray,
duplicate it again and keep feeding it to the Sound object.

I've been messing around with this, off and on, for a while to try and loop
a simple sine wave audio data that I've generated.  It works pretty well,
except that I always get a little 'pop' whenever the next loop starts..
possibly because the phase of the end of the previous loop doesn't match the
start of the next one.


 ------------------------------
Andrew Murphy
Interactive Media Developer
amur...@delvinia.com

Delvinia
370 King Street West, 5th Floor, Box 4 
Toronto Canada M5V 1J9
P (416) 364-1455 ext. 232
F (416) 364-9830  
W www.delvinia.com

-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Jim Andrews
Sent: April 29, 2010 01:52 am
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] gapless looping of external mp3's

I'm new to the list.

Does anyone have experience with gapless looping of external mp3's in Flash?

I'm having probs with it.

I read http://www.compuphase.com/mp3/mp3loops.htm . There's even a section 
in there about gapless looping in Flash.

But I'm not sure how old that page is and if there are better methods now 
than what's described there.

I have done some previous work with gapless looping, but it was all in 
Director, such as at http://vispo.com/nio and http://vispo.com/jig/arteroids

. I'm just learning ActionScript now.

ja 

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to