05-23-2012 11:28 PM
I am working on a video game and have the audio working using OpenAL and wav files.
I was just adding the backing track and noticed that the wav file was pretty big 4mb vs 1 mb vs the original mp3 file
I am trying to get the game to work with the mp3 files to save on space (can not get this to work see other post)
But that has gotten me thinking.
After doing lots of reading on the web I have noted that most sources recommend using wav files over mp3
I would have thought "space" would be a concern for mobile apps such as this, but that does not seem to be an issue in these discussions.
Do people not care about the actual bar size? (effects transmission and space on the tablet)
Should I care?
The bar file is currently about 4-5mb with the backing track it would be 8-9mb
Please note that I have already reduced the bit rate (and done some other tricks) to minimize the file size, the fact remains the mp3 file is much smaller then the wav file.
I also appreciate that there are some legal/philosophical reasons not to use mp3 but I am only thinking about the technical ones.
Solved! Go to Solution.
05-24-2012 11:46 PM
Have you considered shipping as an mp3 and decompressing it to wav when your app installs?
Just a thought.
Most folks will recommend wav files for games because you often want to save cpu cycles for your game, instead of spending them on mp3 decoding. Also, you can much-more easily do random access on a wav file in case you need to do looping, or start playback from some position other than the start of the file, etc.
05-24-2012 11:48 PM
and instead of decompressing at install time, you could always just decompress an mp3 file into ram when your app starts up and forego decoding it on-the-fly in-game. saves disk space, saves download time, but at the expense of some more ram used at runtime.
05-25-2012 08:17 AM
Thanks for your response.
I could not see a recommended way to convert an mp3 to wav file.
Is this something I would need to figure out myself, perhaps using some open source library?
05-25-2012 08:59 PM
It turns out the reason it was crashing was a stupid error on my part
once I fixed that it stopped crashing
After plenty of trial and error I got it to work.
I am also able to play multiple mp3 files at any given time.
I think I will use a hybrid model though, .wav files for the sound effects and .mp3 files for the backing track. I am finding the mp3 files do not seem to be as spunky was the wav file and they just seem off timing wise sometimes.
I am also a little surpised that mmr_stop() is so expensive, it caused glitches in my game, but I moved it to a different thread and all seems fine.