Changing music (OGG/MP3)

The place to discuss all things Lugaru.
Post Reply
YNM
Posts: 2
Joined: Wed Feb 27, 2013 1:54 pm

Changing music (OGG/MP3)

Post by YNM » Wed Feb 27, 2013 2:05 pm

I tried to change some music in game (file "music2.ogg" exactly). I used a MP3-file converted to OGG, but new music in this extension and quality sounds very bad. And if i change file extension to "music2.mp3", the game does not recognize this file and there is no music during the battles. What can be done in this situation? Can I change something else somewhere in the game folder so that the game will start playing file "music2.mp3" (not "music2.ogg") in battle scenes?

User avatar
rudel_ic
official Wolfire heckler
Posts: 2193
Joined: Sun Aug 28, 2005 11:19 pm
Location: Hamburg City
Contact:

Re: Changing music (OGG/MP3)

Post by rudel_ic » Wed Feb 27, 2013 5:02 pm

The game does not play MP3 files at all. You need to encode them as OGG files.

The reason why this is so is that MP3 en- and decoding is bound to a proprietary license in some countries. If you're interested in that topic, check out http://en.wikipedia.org/wiki/MP3#Licens ... ent_issues

OGG on the other hand is public domain: http://www.vorbis.com/faq/#flic
So David chose that format. And that certainly made sense at the time.

There is a free program named Audacity that lets you convert MP3 to OGG files. Just open the MP3 with Audacity and then export it to OGG. It's available for most operating systems. Here's the link to the thing: http://audacity.sourceforge.net/

Note that you most likely will have to change the sample rate, even if you already have OGG files that are supposed to replace the music that ships with the game. The sample rate needs to be at 22050 Hz, not 44100 Hz. This makes the music sound worse indeed, but if you don't do that, you will have the file playing at half time. Which is no good. In Audacity, you can find the thing for changing the sample rate in the lower left corner of the window. Change that to 22050, then export to OGG and you should be fine.

Why half time? Well, there are 44100 samples for a second, but the game only plays 22050 per second, so it takes two seconds to play back stuff that's intended for one second.

Furthermore, the original files are at a sample resolution of 16 bit. So if your files are at a higher resolution, you might want to set that lower as well. I'm not really sure whether or not the game deals with different sample resolutions painlessly, but it's another possible hiccup, so I'm pointing that out. To change the resolution in Audacity, on a track, next to the track name, there's a black arrow pointing down. Click that, choose "Set sample format", then pick "16 bit". (Not entirely sure about the English text in that menu because I only have the German version of Audacity, but you'll figure it out.)

The sample resolution determines the amount of information per (and thus the precision compared to the original sound, ignoring issues resulting from recording methods and A/D conversion, and compression, of) each sample. 16 bit is alright. Not stellar.

YNM
Posts: 2
Joined: Wed Feb 27, 2013 1:54 pm

Re: Changing music (OGG/MP3)

Post by YNM » Thu Feb 28, 2013 1:21 am

Thank you very much for the link! Audactiy works really good! When I converted MP3 with the other convertors, the quality of the OGG files was really terrible. And this converter made it not ideal but good enough for me and my ears. Thank you once again! :D

User avatar
tannim
Posts: 271
Joined: Tue Sep 30, 2008 5:54 pm
Contact:

Re: Changing music (OGG/MP3)

Post by tannim » Thu Feb 28, 2013 5:26 am

adjust the compression of the OGG in the format options during save. I don't remember if higher is better or lower, feel free to experiment.

User avatar
rudel_ic
official Wolfire heckler
Posts: 2193
Joined: Sun Aug 28, 2005 11:19 pm
Location: Hamburg City
Contact:

Re: Changing music (OGG/MP3)

Post by rudel_ic » Thu Feb 28, 2013 5:05 pm

YNM wrote:Thank you very much for the link! Audactiy works really good! When I converted MP3 with the other convertors, the quality of the OGG files was really terrible. And this converter made it not ideal but good enough for me and my ears. Thank you once again! :D
You're welcome! Audacity is a must-have on any machine.

User avatar
Count Roland
Posts: 2937
Joined: Tue Sep 25, 2007 11:15 pm
Location: Galapagos Islands, rodeoin some turtles.
Contact:

Re: Changing music (OGG/MP3)

Post by Count Roland » Fri Mar 01, 2013 12:36 am

I'm always amazed at how well rudel knows his stuff.

User avatar
rudel_ic
official Wolfire heckler
Posts: 2193
Joined: Sun Aug 28, 2005 11:19 pm
Location: Hamburg City
Contact:

Re: Changing music (OGG/MP3)

Post by rudel_ic » Fri Mar 01, 2013 10:41 pm

Haha come on.. Audacity is pretty popular, and the ogg specifics I got from Anton tinkering with the music. The technical explanation is from Wikipedia and the MP3 licensing thing has blown up a few times over the years.

I'm just an old fart, that's all it is, really.

User avatar
Count Roland
Posts: 2937
Joined: Tue Sep 25, 2007 11:15 pm
Location: Galapagos Islands, rodeoin some turtles.
Contact:

Re: Changing music (OGG/MP3)

Post by Count Roland » Sat Mar 02, 2013 4:27 pm

I wasn't just referring to this, I was referring to like every lugaru post you answer.

User avatar
rudel_ic
official Wolfire heckler
Posts: 2193
Joined: Sun Aug 28, 2005 11:19 pm
Location: Hamburg City
Contact:

Re: Changing music (OGG/MP3)

Post by rudel_ic » Sat Mar 02, 2013 7:31 pm

Oh okay. I love the game, and I've played it for what, 6 years now? So I guess it's natural to know everything about it.

And it's also fun to dig into things sometimes when weird questions come up with these mid-2k indie titles because they're like old cars, you can always do something to them yourself to make them work again. I like knowing what screw to loosen to bring the ignition back.

And some questions just came up repeatedly in these forums, and I've read the answers and haven't forgotten them, that happens a lot as well.

Post Reply