quote:Original post by ageny6
quote:Original post by dede
You can use zlib to compress your wav in a zip, then zlib again to decompress and load during game play. It will still be a wav file, but it will be smaller.
If you have a, for example, for minute song, and that it is about 40 someodd number of megabytes, does that mean that you get to load 40 megabytes worth of wav in memory?
Depends. You can get away with double buffering your music.
Here''s are blocks of music
ABCDEF...
Load AB, play A, get B ready. When the A stops, start B. Erase A and load C. Repeat til end, and restart. That is a way you can get around 40 megs. zlib allows you to load things in blocks, you''ll just have to generate header information, which would be faster than decompressing a mp3.
If you do it in another thread(i.e. a mult-threaded application), it probably wouldn''t be too much of a preformance hit. You''ll have to play with how big your block size is too, you want it to be long enough to have enough time to get the next one, but not too big.
You can also just not care, since Windows has 2 gigs of virtual memory to play with. You''ll just have a very long loading time!
If you talking about 40 megs, I''d just use either .mp3 or .ogg. DirectShow has mp3 decompression, and .ogg has its own decompression for free. I''d go with mp3, since it is slightly more mature at this time, so it decompresses a bit faster.
~~~~~
"the best thing about betting on apathy is that even when you lose, you dont care." - nethead.
Download and play Slime King I.