Implementing sound - wav or mp3 ?

Blitz3D Forums/Blitz3D Beginners Area/Implementing sound - wav or mp3 ?

Dax Trajero(Posted 2005) [#1]
Which format is the least cpu intensive ?

MP3 or WAV ?

I'm at the point where I'm editing my sound samples and have the option to convert them into either MP3 or WAV depending on which is best for Blitz.


Chad(Posted 2005) [#2]
If you want to keep the size of your project down for downloads and stuff, MP3 is the way to go, but quality is wav, or I think so, because most games use wav.. It's more of a personal opinion, in my opinion.


Beaker(Posted 2005) [#3]
Ogg is better than MP3 - no license issues.

If you are loading them into memory (using LoadSound) then I think they are the same CPU processing wise.


Tom(Posted 2005) [#4]
Yup, I'm 99% sure all audio formats are unpacked to memory before being played, so you're only saving on disk space. Go with Ogg for the reason Beaker said.


Damien Sturdy(Posted 2005) [#5]
Ogg is the best compromise.. They also allow for looping sounds, where mp3 tends to have gaps at the end of the track.

WAV is the best format of all, but because its uncompressed, 4 minutes of stereo, CD Quality audio would be about 40mb in size. (Thats how it always was before- Now you know why mp3 was such a breakthrough ;) )

One more thing that should probrably be mentioned for you:

If you ever think of converting your mp3s to OGG, don't. mp3 lowers the quality. re-encoding the mp3 to ogg will lose even more quality because of how ogg/mp3's work.

always convert from WAV to ogg, or WAV to whatever you need- Looks like from your first post, youre doing it right :)


Dax Trajero(Posted 2005) [#6]
ok, great - original samples are in wav and are 60kb each. I need 4 loaded into RAM at any one time.

I'm dying to hear my game with sound for the first time - I think it'll really help 'bring it alive'


VP(Posted 2005) [#7]
Use OGG. Even at extremely high quality settings, filesize is much less than the original WAV.

Personally, I'm keeping everything as WAV for the development branch of my game and OGG in the release branch (I have both dev/ and release/ folders for my project which I archive between versions).


xlsior(Posted 2005) [#8]
He's not asking about filesize, he's asking about CPU intensiveness.

MP3 is significantly more CPU intensive than WAV is, but since the MP3 filesize are so much smaller it is worth it most of the time.

the same goes for OGG, it's more work for your computer to play than when dealing with .WAV's.


VP(Posted 2005) [#9]
I know he's asking about CPU intensiveness, but someone already pointed out that this is a moot point because the CPU is only used to decode the MP3/OGG at LoadSound time, not during the normal run of the game. I didn't see a reason for me to reiterate something already said.


jhocking(Posted 2005) [#10]
Since load time is the only difference in cpu intensiveness, that's the part to examine. For long detailed sound files (eg. music) the filesize savings of ogg are necessary, but ogg means significantly higher load times. wav is best for sound effects; in many cases, they load so fast you could do it on the fly to save memory.


VP(Posted 2005) [#11]
I still believe it to be more important to keep filesize low in order to minimise the length of time your game takes to download.

Decoding mp3 or ogg really doesn't take that much CPU power, compared to the inconvenience of a dialup user downloading a 20MB distributable instead of a 10MB one (more than 1h25m compared to under 40m).

I will admit that it does largely depend on your target audience ;)