Bob
Bob

Reputation: 255

What is a good format for storing sounds on windows compressed?

Currently we use .wav files for storing our sounds with our product. However, these can get large. I know there are many different sound files out there, however what is the best sound file to use that will:

1) Work on all windows-based systems (XP+) 2) Doesn't add a lot of extra code (ie: including a 3 mb library to play mp3's will offset any gains I get from removing the .wav files) 3) Isn't GPL or some code I can't use (ideally just something in the windows SDK, or maybe just a different compression scheme for .wav that compresses better and works nicely with sndPlaySound(..) or something similar.

Any ideas would be appreciated, thanks!

Upvotes: 2

Views: 157

Answers (3)

Larry Osterman
Larry Osterman

Reputation: 16142

I'd look at DirectShow and see if you can use the DirectShow MP3 or WMA codecs to compress the audio stream. All the DLLs are in-box on Windows so there's no additional redistributable needed.

Upvotes: 0

Michael A. McCloskey
Michael A. McCloskey

Reputation: 2411

While WAV files are typically uncompressed, they can be compressed with various codecs and still be played with the system API's. The largest factors in the overall size are the number of channels (mono or stereo), the sample rate (11k, 44.1k, etc), and the sample size (8 bit, 16 bit, 24 bit). This link discusses the various compression schemes supported for WAV files and associated file sizes:

http://en.wikipedia.org/wiki/WAV

Beyond that, you could resort to encoding the data to WMA files, which are also richly supported without third party libraries, but would probably require using the Windows Media SDK or DirectShow for playback.

This article discusses the WMA codecs and levels of compression that can be expected:

http://www.microsoft.com/windows/windowsmedia/forpros/codecs/audio.aspx

Upvotes: 1

user226555
user226555

Reputation:

If the totality of the files is what 'gets large' rather than individual files, so that the time taken by the extra step does not prevent timely action, you might consider zipping up the files yourself and unzipping them as needed. I realize this sounds, and in many cases may be, inefficient, but if mp3 is ruled out it may be worth looking at depending on other (not mentioned in your question) considerations.

Upvotes: 1

Related Questions