View unanswered posts | View active topics

Reply to topic  [ 5 posts ] 
Gaplessly Looping MP3s in FlashDevelop Projects 
Author Message

Joined: Tue Mar 19, 2013 9:19 pm
Posts: 1
Reply with quote
First, a huge apology if this is the wrong forum (edit: thanks to the moderator who moved this!).

I was working on a Flash game in FlashDevelop and was frustrated by my inability to gaplessly loop some background music. MP3s have delays inserted to the beginning and ending of the audio files, so looping them results in a slight pause or stutter when the track restarts.

Long story short, I wrote a program to generate gaplessly loopable MP3s (contained in SWF files) that can be used in FlashDevelop projects. I'm pretty happy with the results, because some of my tests show that my program is "more gapless" than Adobe Flash Professional (I've tested CS5; I don't have access to CS6 to test it). I intend to use this program to gaplessly loop my background audio tracks for my FlashDevelop projects, and I figured I'd try and share it with the community in case it's useful to anyone else.

The github repository for my little side project can be found here. Using it is pretty simple: select a source audio file (must already be gapless, so I don't suggest starting with an MP3), set your quality parameters, set your ActionScript3 class name, and save the generated SWF. Then import the SWF into your FlashDevelop project like you would any other, referencing the Sound asset (you know, the "[Embed(source = 'MySWF.swf', symbol='MySoundClassName')]" stuff). I hope this is useful to someone else!

Tue Mar 19, 2013 9:31 pm

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Reply with quote
Woah, that's pretty amazing - thanks!

Wed Mar 27, 2013 10:18 pm
Profile WWW

Joined: Wed Mar 27, 2013 8:17 pm
Posts: 5
Location: Moscow, Russia
Reply with quote
when i faced this gaps in playing mp3 loops, i used .wav files instead of .mp3
.wav loops don't have gaps

Mon Apr 01, 2013 6:18 pm

Joined: Sun Mar 23, 2008 2:28 am
Posts: 176
Reply with quote
Cool, can you give a quick summary of how it works?

Wed May 22, 2013 12:35 pm
Profile WWW

Joined: Fri Jun 28, 2013 1:09 am
Posts: 2
Reply with quote
An alternative to this is to download the "mp3 loop utility" by Compuphase (I don't know if I'm allowed to link to it and can't be arsed to read the forum rules just now as I've spent all night trying to find a solution to this mp3 gap problem).

It converts a wav to mp3 adding only a tiny bit of silence to the beginning that the wav doesn't have. The silence isn't perceptible in the loop I tested, hopefully this is the case for you too.

The instructions tell you to put MP3Loop in the same folder as the lame encoder (After a lot of trying I discovered I had to put it into the same folder as the "enc_lame.dll").

Using wav files in my flash game just aren't an option for me because of the file sizes, so I hope flash starts supporting some better audio formats than mp3 soon.

Fri Jun 28, 2013 3:40 am
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.