Starling2D extension to allow playing of looped mp3's without the 'click' as it loops (due to the issue with mp3 frame sizes).
In short mp3's are terrible for looping. The way the codec works you end up with encoder and decoder delay at the start and potential padding at the end. When this plays you gets little gap when it loops :(
Thankfully there is a solution if you've used LAME to do the encoding.
To use this library you have four choices (in preference order):
1. (Recommended) var rain:Sound = GaplessLoopedSound.createWithLAME(assets.getByteArray("rain")); 2. var rain:Sound = new GaplessLoopedSound(assets.getSound("rain"), delay, padding) 3. var rain:Sound = GaplessLoopedSound.createWithGuess(assets.getSound("rain"), originalSampleLength); // guesses 4. var rain:Sound = new GaplessLoopedSound(assets.getSound("rain")); // uses some defaults which might work
%gist(8106250)%
Feel free to edit this part of the page!