If you create an mp3 in SoundBooth or Sound Forge and loop it, even in those environments, you see that simply creating an mp3 introduces some silence at the beginning and end of the file. Even if the mp3 was made from a perfectly gapless looping wav file, the mp3 will have a gap in it.

Consequently, if one wants to use external mp3's in Flash (or any other program) things get a bit tricky.

I've read a couple of good docs on this at
http://blog.andre-michelle.com/2010/playback-mp3-loop-gapless/#more-590
http://www.compuphase.com/mp3/mp3loops.htm

The first URL contains some excellent ActionScript code for gaplessly looping an mp3--as long as you know the total number of samples in the wav file from which the mp3 was made. This code was written by Andre Michelle, probably one of the main people who made http://audiotool.com , which is a very impressive Flash audio app.

The second URL is very good also, but after investigating it quite a bit, my conclusion is Andre Michelle's code is the way to go if you want to gaplessly loop external mp3 sounds. But, again, this presupposes that you know the total number of samples in the wav from which the mp3 was made.

A good alternative, which I haven't tried yet, is to create external SWF files that contain groups of wav files, let the user select which group they want to use, download the SWF, and use it as per Glen and Kenneth's suggestions in this thread.

ja
http://vispo.com

ps: Here are some interesting online interactive audio apps: http://vispo.com/misc/ia.htm

----- Original Message ----- From: "Karl DeSaulniers" <[email protected]>
To: "Flash Coders List" <[email protected]>
Sent: Thursday, April 29, 2010 5:03 AM
Subject: Re: [Flashcoders] libraries of wav files?


I would set it up using XML.

I think the trick to loading MP3s and having them loop is to preload them. Then figure out how long till the sound plays and how long is left after the sound ends to the end of the track. Time your next song in line to start playing before the other ends at the right point to where the current ends
the next in line has had time to get to the point where its sound  starts.
Then do a little DJing utilizing some kind of fade of the volumes. :)
You could even have them overlap some to have that cross-fade effect.
If anyone has a better suggestion, I am all ears as well.

Best,

Karl

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to