Page 1 of 1
Ingame music: WAV / MP3

Posted:
Fri Jun 11, 2010 12:09 am
by Freem4n
This question is propably stupid...
usually, many game developers and modders use the mp3 format for ingame music, while sound effects and any other sounds are in WAV. But I don't really get the point. Why not just having everything in WAV?
Re: Ingame music: WAV / MP3

Posted:
Fri Jun 11, 2010 12:20 am
by Dives
Many use mp3 for music because it is a much smaller file size than wav. However not all sound files are mp3 because there is less processing needed when playing wav files. You can try it in source. Make a bunch of mp3 files played my ambient_generics and occasionally the game will stutter when it tries to play one. That doesn't happen with wavs.
Re: Ingame music: WAV / MP3

Posted:
Fri Jun 11, 2010 12:24 am
by Terr
MP3: Compressed, but takes more CPU power to prepare and play.
WAV: Uncompressed, but very fast and easy to play lots of them at once or on-demand.
Therefore you tend to find MP3's for long non-interactive stuff like music, and WAV's for short noises where you might want to be playing a kerjillion of them at the same time from different places in the game world.
Re: Ingame music: WAV / MP3

Posted:
Fri Jun 11, 2010 8:18 am
by Freem4n
Thanks!
I guess, that's why in L4D most tracks are in wav, because of the dynamic playback.
So in the end, it doesn't matter whether I use WAV or MP3 for music tracks, only if I want to save a few MB, I should use MP3, correct?
Re: Ingame music: WAV / MP3

Posted:
Fri Jun 11, 2010 8:23 am
by Dives
Freem4n wrote:Thanks!
I guess, that's why in L4D most tracks are in wav, because of the dynamic playback.
So in the end, it doesn't matter whether I use WAV or MP3 for music tracks, only if I want to save a few MB, I should use MP3, correct?
If its a track longer than 20 seconds, I'd go for mp3. Just remember mp3 can't be auto looped in source without obnoxious jury rigging.
Also wavs are currently broken for L4D2 if they are in a vpk. Until Valve fixes it (which was supposed to be fixed 6 weeks ago), you're going to have to use mp3s.