tags:

views:

55

answers:

3

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!

+1  A: 

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.

mickeyf
+1  A: 

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

Michael McCloskey
+1 for WMA. Not the most popular format, but suitable on Windows.
Michael Stum
I am going to attempt just decreasing the sample rate, making sure its mono, etc. Do you have any suggestions for quick tools to just convert between formats (ie: I do not need a massive audio-editing suite). I may try to boot into an XP box to see if sound recorder does it (Vista's doesn't seem to load files anymore).Then if they do not get down small enough, I will try out the WMA solution, as that does seem to make sense since its a windows-only app. Thanks for all the good ideas.
Bob
I would suggest giving Audacity a go. It's free, open source and isn't too cumbersome.http://audacity.sourceforge.net/I just gave it a quick spin and it does allow setting the project sample rate and configuring WAV compression in the preferences to a certain degree.
Michael McCloskey
A: 

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.

Larry Osterman