Jump to content

  • Log In with Google      Sign In   
  • Create Account

short sounds versus long sounds


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 TheBuzzSaw   Members   -  Reputation: 110

Like
0Likes
Like

Posted 29 May 2011 - 04:06 PM

I am rather uninformed in the world of audio; be gentle. :)

It seems that older games would use MP3 or OGG for long music/dialog sequences and use WAV for all the short sound effects. Was this strictly for compression/size reasons? In terms of my own game development, is there any real downside to using all OGG files for both long music files and short sound effects? What do I need to watch out for?
Amateurs practice until they do it right.Professionals practice until they never do it wrong.

Sponsor:

#2 deadstar   Members   -  Reputation: 470

Like
5Likes
Like

Posted 29 May 2011 - 04:38 PM

WAV files contain uncompressed PCM audio, which can be opened, read and fed straight to the sound chip with no data conversion. If you have a scene in your game with 40+ sound effects playing simultaneously, this is ideal, since there's little CPU time involved and the sound chip does all of the work. OGG files require a lot more work from the CPU to decode on the fly. Data must be decoded - in realtime - into packets of PCM data, which is all done using the CPU. If you try to do this with 40+ simultaneous files, your system will choke.

There's no "one size fits all" audio format, UNLESS the hardware supports the decoding on the fly. On the Xbox 360 for example, the sound chip is custom designed to handle the decoding of XMA2 data, so that one format can be used for one-shot sound effects, long dialogue or to stream in music tracks.

It is possible to open all the necessary OGG files at load time, decode them and have the PCM data sit there in memory ready for use, but that all depends on your target platform - I wouldn't consider a method like this for iPhone, for example. Since I try my best to code cross-platform, I find using WAVs for sound effects and OGG for long tracks to suit the majority of devices just fine.
"The right, man, in the wrong, place, can make all the dif-fer-rence in the world..." - GMan, Half-Life 2

#3 Ninjaboi   Members   -  Reputation: 112

Like
0Likes
Like

Posted 29 May 2011 - 10:06 PM

Glad you summed that up deadstar, I didn't know that. +1 to post.

#4 TheBuzzSaw   Members   -  Reputation: 110

Like
0Likes
Like

Posted 29 May 2011 - 11:59 PM

Ah! That clears it up very nicely. Thank you much, deadstar.

So, if my target platform is, for instance, the big three (Windows/OSX/Linux), using all OGG files loaded in memory is a viable option?
Amateurs practice until they do it right.Professionals practice until they never do it wrong.

#5 scgames   Members   -  Reputation: 1977

Like
1Likes
Like

Posted 30 May 2011 - 05:31 AM

So, if my target platform is, for instance, the big three (Windows/OSX/Linux), using all OGG files loaded in memory is a viable option?

A relatively long stereo sound (e.g. a music track) decompressed can require many MB of storage, so it probably just depends on how many music tracks and/or other memory-intensive sounds you have, and what your memory budget is.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS