Need help decreasing size of a .wav

I am using Windows 8.1 an Audacity 2.1.0
So I am working on creating a map on Source SDK for CS:GO and I decided to add some music. The music files are .mp3 and all range between 9-10 Mb. I used audacity and exported them as .wav files at 44100Hz, but then each file became up to 40Mb in size and it has drastically inflated the size of my map which itself is a .bsp at 16 Mb. Is there any way I can convert my files to .wav but keep their size up to 10Mb?

Simply said: no.

Either you export to mp3, or you reduce bitrate/samplerate, but that will affect quality too.

I suppose you use 44.1 KHz, 16 bit. Reducing to 22 KHz won’t affect the sound too much, but it might not play back on every device. And if your OS upsamples automatically, it will affect performance a little bit.

I think mp3 would be your best bet for a gaming? application.

FYI - If you know that there are 8 bits in a byte, and you know that the sample rate is the number of samples per second, you can calculate file size for an uncompressed WAV:

File Size in bytes = (Sample rate in Hz) x (bit depth/8) x (Playing Time in Seconds) x (Number of Channels).

For compressed files the bitrate (kbps) is kilo_bits_ per second, so:

File Size in bytes = (Bitrate in kbps/8) x 1000 x (Playing Time in Seconds)

Of course, you can modify those for megabytes & minutes.

For example, CDs are 44,100 Hz, 16-bits, 2-channel stereo. That works out to about 10MB per minute.

We don’t normally refer to uncompressed files by their bitrate, but a CD (or a 44.1KHz, 16-bit Stereo WAV) works-out to 1411 kbps.

Have you tried Other Uncompressed Files then the ADPCM WAV (4-bit formats) if you must have WAV? They are not too bad quality. If your file is mono, ADPCM will not be much larger than 128 kbps MP3.

Gale

Most people use “Wave” synonymously to “Uncompressed PCM”. However, Wave is actually a container format, very similar in structure to the AVI container (both are flavors of RIFF). This means that Wave files can store a variety of different audio formats. Uncompressed PCM is only one out of many supported formats, though it’s probably the most widely used one. Nonetheless, Wave files can also store various compressed formats, such as ADPCM, AC3, DTS and even MP3. There are many more formats, including various “exotic” ones. Anyway, be aware that not every application that can “read Wave files” necessarily supports all formats that can be in Wave file!

See list here:
http://www.onicos.com/staff/iz/formats/wav.html

For 99% of apps, WAV means uncompressed PCM data, IMHO.

The only one I can think of that knows more WAV formats, is sox…

Not necessarily. Most native Windows programs use the Audio Compression Manager (ACM) to read from or write to Wave files.

This means that the audio formats that an application “supports” in Wave files depend only on which ACM Codecs are installed on the computer.


(BTW: FFmpeg uses its own “built-in” decoders, of course, but it should support pretty much any relevant format from Wave container too)

If it is necessary to export from Audacity as WAV using a codec not listed in “Other Uncompressed Files”, yes you can install FFmpeg then choose “Custom FFmpeg Export” when you export. Select WAV for format in the list on the left and the required codec in the list to right of that.

MP3 inside WAV is known to work using Custom FFmpeg Export, but some codecs inside WAV may not export correctly.


Gale