Sound performance

Miscellaneous Forums/General Discussion/Sound performance

Hi,

has anyone made a performance test already of how much more performance heavy usage of ogg files costs instead of using uncompresed wav files for instance?


Thanks,

taumel

None. Files are not streamed from disk, but loaded into memory. In fact using an uncompressed wav file may be the performance hog (due to it's filesize it will take longer to load from disk).

Hmm so what's stored in memory?

The compressed one or an already decompressed on? If it's the second then why is there a difference in filesize. It should be the same then if i would compare a wav with an ogg file for instance. Wav doesn't use any lossless compression as far as i know.

None. Files are not streamed from disk, but loaded into memory


So a wav will take slightly longer to load from disk -- but after that, the actual playback of a WAV is trivial, while .OGG decompression is not insignificant, especially for a slower CPU.

Any benchmarks to back up that "None"?

@xlsior
That's the question i was asking myself...is the ogg decompression done each time i start an ogg sound and if so how much does it cost.

In the case of BlitzMax oggs are decompressed into ram at load time so incur no processing penalty during playback.

So a 4 minute ogg will turn out to be 40MB in memory??

Interesting to know, but at this point the quality settings of the .ogg files influence or not the decrompression size in RAM?

Actually some figures here would be very useful:

e.g. if a wav file is 40MB and an OGG file is 10 MB when compressed but 40MB when in ram ready to play, then the difference is in how much memory the stored/compressed file takes (say for downloads size) and how long it takes to decompress and what happens to other cpu processes at that stage.

IPete2.

while .OGG decompression is not insignificant, especially for a slower CPU.
Sure. If you're developing for a C64. Otherwise the harddrive speed (particularly for fragmented harddrive) is going to be a much more significant factor than copying memory around (aka. decompression). PArticularly in a singlethreaded environment where file I/O is a blocking call.

If it's the second then why is there a difference in filesize.
Because ogg/vorbis is a compressed file format.

Any benchmarks to back up that "None"?
I don't really have the harddisk space to store any significant ammount of wav audio, so no. But making said benchmarks is fairly trivial.

So a 4 minute ogg will turn out to be 40MB in memory??
I don't know about the exact numbers, but yeah something like that.

Interesting to know, but at this point the quality settings of the .ogg files influence or not the decrompression size in RAM?
No. The ogg file will use as much memory as a comparable uncompressed wav. It will just load faster.

Hm.. that raw wave in RAM bothers me somewhat. For more fantasy'ish RPG's it's not unthinkable to have tunes up to 8 minutes (there're tunes of that size in Diablo 2/exp). That would eat up a whopping 80MB, not exactly a number I'd wish for..

I might have missed something here but which product are we talking about?
Skid mentions Bmax which *natively* doesn't stream from disk but can with Maxmod... can't it?

@skiracer
Okay thanks!

@FlameDuck
We were not talking about the same thing. I've misunderstood you as i thought you meant the memory allocated space an if it's decompressed it obviously should have the same size as a wav according to the settings (resolution,frequency,channels).

yeah basically if I run my game and look at the memory use in Task Manager before and after I load in a tune, it goes up by 20-40MB dependin gon tune length.

Hey, my musician reported choppy sound, include 0.5 second silences, when he played Holiday Bonus (a BMax game) on his Windows 98 PC. It has plenty of RAM and isn't slow so does anyone know any more about the BMax win98 sound issue? I thought it was solved a while back, but this seems no tobe the case. He actually made a recording of it for me which I aim to post in the bug forum soon.

For more fantasy'ish RPG's it's not unthinkable to have tunes up to 8 minutes (there're tunes of that size in Diablo 2/exp). That would eat up a whopping 80MB, not exactly a number I'd wish for..

Would it not be possible to create an audio system that streams or decompresses files on the fly for memory-related issues in those cases?
(would be a balancing act between CPU & RAM from the looks of things...)

I use FMOD instead, and I tend to pay the $100 when necessary.

I tried to wrap Audiere a while ago but it only works with Win32 and DLL size is about big, otherwise it's music playing ability is good as FMOD .

Those who only want to play XM and don't want to pay $100 can use uFMOD at http://ufmod.sf.net