mp3 vs wav

Ambient sounds, game effects and music creation.

mp3 vs wav

Postby Glra on Wed Nov 27, 2013 2:36 pm

Is there any reason why game developers use mp3 for background music and wav for sound effects?
Is it just because of the file size?
Can't I just use wav for everything (including music)?
Glra
Just Joined
Just Joined
 
Joined: Wed Nov 27, 2013 2:27 pm

Re: mp3 vs wav

Postby LordDz on Wed Nov 27, 2013 2:52 pm

My mp3s are about half the size of .wavs, so yeah.. File size matters quite a lot.
Not sure about quality and such stuff.
User avatar
LordDz
May Contain Skills
May Contain Skills
 
Joined: Mon Sep 01, 2008 12:28 pm
Location: Hammer Crash Logs

Re: mp3 vs wav

Postby wereMole on Wed Nov 27, 2013 3:09 pm

I used to create music with fasttracker and before converting it to a suitable format it was in .wav and those files were humongous. Thinks worked with floppydisks back then and I remember it was terrible getting those files from and old laptop years later.
User avatar
wereMole
Regular
Regular
 
Joined: Tue Jun 13, 2006 10:55 am
Location: Netherlands

Re: mp3 vs wav

Postby SM Sith Lord on Fri Nov 29, 2013 7:02 pm

MP3's compression cause problems when trying to loop sound. Source gets around this by looping via cue points added into the mp3 file itself. Unity requires you to use WAV if you want it to loop properly, even though it supports mp3's as well.
SM Sith Lord
Been Here A While
Been Here A While
 
Joined: Sat Nov 25, 2006 4:25 pm
Location: Los Angles, CA

Re: mp3 vs wav

Postby nub on Sat Nov 30, 2013 8:11 am

WAV is uncompressed, therefore "lossless" in audio fidelity, but the file size is huge. MP3 is compressed, therefore "lossy" in audio fidelity, but the file size is much smaller.

You can certainly use WAV for everything, but for full-length songs the file sizes will be huge. The file sizes for WAV files are mainly determined by the length of the track. The longer the sample, the larger the file size. There's alternative lossless formats available, but they aren't supported by Source, let alone probably 99% of all the other games out there. FLAC for instance is an extremely popular alternative to WAV. It's much more efficient in file size while maintaining a lossless quality. MP3 uses compression in order to create small files. Not only is the length of the track a factor in file size, but so is the audio bitrate. The higher the bitrate, the better the audio quality and larger the file size; and vice versa. There are probably other factors at play, but I'm not that informed in this area.

If you're composing your own music, I personally suggest rendering it out at a bitrate of 320 kb/s, or close to that at least. That way you will have good audio quality without the absurd file sizes. In the middle of a game, the audio fidelity isn't going to matter nearly as much as it would if you were listening to just the music with a pair of high end headphones or speakers. You might be able to get away with lowering the bit rate a notch below 320 kb/s before the quality is noticeably low; if you're that worried about file sizes.

Valve's method is that all music is MP3 (unsure of bitrate, but I don't think it's 320 kb/s), and all the physics and environmental sound effects and whatnot are WAV. I believe all the character dialog is WAV as well. Don't quote me on that though. I imagine something that important would be lossless quality.

Source's audio system is rather outdated if I recall. A lot of the more modern titles out there are using the FMOD sound system, which is designed specifically for game engines and such. I think OGG is a popular file format for games as well. I believe it's similar to MP3, but more efficient and capable of lossless quality or something. Again, I'm not 100% sure about this.
User avatar
nub
Veteran
Veteran
 
Joined: Tue Nov 15, 2005 1:11 am
Location: Charlotte, NC, US

Return to Audio

Who is online

Users browsing this forum: No registered users

cron