That horrible MP3 gap

Monkey Targets Forums/Flash/That horrible MP3 gap

Gerry Quinn(Posted 2011) [#1]
I'm doing a game involving a bouncing ball. And I can't get an MP3 for the 'bounce' sound that doesn't a gap of at least 0.06 seconds at the start, which is way too long.

I tried storing a stereo sound with maximum bitrate, hoping that the inefficiency might apply to the start of the sound, but it always seems to default to a gap of about the same length.

Is there any cure?

Do Adobe hate Flash games or something? This and the absence of a right mouse button (I should say the presence of a useless and annoying right mouse button) seem like they are almost designed to give gamers a bad experience. I really hope HTML5 supersedes it fast.


skid(Posted 2011) [#2]
The last game developers I worked with would keep a silent loop playing in Flash to keep the audio engine from requiring initialization when it was really needed. Not sure if this approach will help with your problem.


DerHase(Posted 2011) [#3]
I had the same problem. I found out that some mp3 converters put silence at the beginning and the end of the sound file. I cut it with Audacity and saved it again, now it works for me.


matt(Posted 2011) [#4]
@DerHase is correct. Try a different editor.


Gerry Quinn(Posted 2011) [#5]
Only one problem... I'm using Audacity and it keeps putting the silence in! I'll try a few others and report back if I find one.


matt(Posted 2011) [#6]
It's something to do with the first sample being on a boundary. My editor (Fission, Mac) allows me to edit by block to avoid these gaps.

You could also try a different file format.


dawlane(Posted 2011) [#7]
If you want to get rid of the gap check out the post in the ios section there are a few links to some tools to do this.
http://www.monkeycoder.co.nz/Community/posts.php?topic=1577
A bit of googling will explain why it's there.