PDA

View Full Version : looping mp3's for ambience



His Frogness
10-30-2003, 06:06 PM
I\'ve resorted to post this because I\'ve utterly failed at finding the information myself. I want to use MP3\'s as a bed for the ambient audio in the game I\'m working on. In addition, I was going to add various 22k .wav files of very specific audio (creatures stirring, wolf howls) that would be randonly chosen (very infrequently mind you)and randomly placed in a 3d environment. Well our programmer has all of it in place, the problem is that I can\'t find a way to encode MP3\'s without putting 10-15 milliseconds of silence in the head and foot of the MP3 file!!!!! I\'ve tried every compression codec available and they all put that space in. OGG doesn\'t, but it\'s too late to switch to that. I\'ve tried finding programs that edit MP3\'s without having to un- and re-compress but I\'ve only found one, MP3 Frame Editor 2.22 by Miodrag Malovic. It doesn\'t work correctly and still leaves space at the head.

I cannot believe that I\'m the first person to try seemlessly looping MP3\'s. I\'m sure there\'s some obvious solution that I\'ve not realized. Can someone offer some solution here?

Ed Lima
10-30-2003, 06:45 PM
No, it\'s not just you. This is a real problem with MP3s. A number of us have encountered this and as far as I know, no one\'s gotten them to loop seamlessly. But all is not lost. Instead of MP3s, use Ogg Vorbis compression. It\'s (imo) better sounding than MP3, AND it\'s open-source, which means no licensing fees to Fraunhofer (sp?)Oggs are just great. I\'ve used them on the last three games I\'ve worked on to great success.

His Frogness
10-30-2003, 06:49 PM
Originally posted by Ed Lima:
No, it\'s not just you. This is a real problem with MP3s. A number of us have encountered this and as far as I know, no one\'s gotten them to loop seamlessly. But all is not lost. Instead of MP3s, use Ogg Vorbis compression. It\'s (imo) better sounding than MP3, AND it\'s open-source, which means no licensing fees to Fraunhofer (sp?)Oggs are just great. I\'ve used them on the last three games I\'ve worked on to great success. <font size=\"2\" face=\"Verdana, Arial\">Thanks Ed,
I knew that ogg did\'t add the silence but as I stated, it\'s too late to switch (according to our programmer) I\'ll have to give him some more crap about this though. We\'re using Miles and that\'s why they went with MP3 and that happened before I came on board.....bastards!

BTW, do you know if ogg supports vbr?

dwdonehoo
10-30-2003, 09:37 PM
Well, tell the programers to switch to ogg or program things to start 10-15 milliseconds before they need it.
If ogg is open source, I can\'t imagine it being so hard to program: no more than changing the code of an object or function and an extra include. This from someone who is also a software engineer.

TLarkin
10-31-2003, 03:54 AM
We encountered the same problem with WMA. Ended up switching to OGG, but in the meantime, a workaround was this.
Create another loop that we called the fade loop. It can crossfade over the beginning and end of the other loop, thus covering up the empty space. In order to play correctly you might need to make it the same length as the first loop with silence except for the crossfade area. It worked for us.
Good luck.
Tim

His Frogness
10-31-2003, 03:54 PM
I appreciate all the info guys, it helps a lot.

So do any of you who use ogg know of a decompressor for Miles? Our progammer thinks he\'s going to have to write one.

Ed Lima
11-01-2003, 10:39 PM
BTW, do you know if ogg supports vbr? [/QB]<font size=\"2\" face=\"Verdana, Arial\">VBR? Visual Basic Runtime? No idea, froggydude.. I\'m 100% the WRONG guy to ask coding questions. Though I will say that putting the ogg decompressor question to the RAD guys is a good idea. I can\'t imagine that they aren\'t at least close to releasing their own ogg playback codec or .dll for Miles, if they haven\'t done so already.

guybrush threepwood
11-03-2003, 04:35 AM
vbr= varible bit rate. And yes, ogg does, in fact it encodes in vbr by default

Ed Lima
11-03-2003, 10:29 AM
Ohhhhh... got it.. yes, as Guybrush said.