Dramatically reducing file size of a WAV for an online game

Hi guys,

I’ve written some music for an online game that comes in at roughly 7mins 20secs and produces a stereo WAV file of around 70MB at 44.1KHZ 16-bit. I’ve just been told by the game people that the piece they’re replacing with mine is in WAV format but is only 400KB in size, and they need mine to be a relatively similar size - theirs is shorter, probably 2mins long, so mine would be longer but needs to be in the same ball park.

I’ve never had to go about producing a WAV file even close to that size before, and they definitely want it in WAV format, rather than MP3 or compressed formats. I’m at a bit of a loss. I know I can half the size by going mono. But how do I get it much smaller whilst still being a WAV and without just producing something that sounds horrible? Help!


I don’t think that is possible without looping.
2 minutes, mono, at 8000 Hz sample rate ADPCM encoded WAV (4 bit) comes in at 491.6 kB.

That may explain how it was done with the piece of music they have then. I know mine will have to come in bigger as it is a long piece of music to start with. But if I could get it down to 2MB or less, that would be something. Is what you suggest the only way?

I’d suggest that you get back in touch with the game people and ask them precisely what format they need the music in. You need to know:

  • Number of channels (mono/stereo)
  • Sample rate (usually one of: 8000, 11025, 16000, 22050, 32000, 44100)
  • Bit depth (usually 4, 8, or 16)
  • Bit format (Signed, Unsigned or Float)
  • Encoding (Usually one of: PCM, A-law, u-law, Microsoft ADPCM, IMA ADPCM, GSM 6.10, G 721 ADPCM)

What is likely to most harm the sound quality, and what harms it least? Any recommendations? In terms of the encoding, I could only see ‘WAV’ (which I assume is PCM) and GSM 6.10 in Audacity. Would I need to download other plugins to enable these other formats? At the moment I’ve managed to produce a 16kHz 8-bit mono file that comes in at 6.67MB and it mostly sounds okay, but lots of hiss and a bit of distortion.

I’m beginning to suspect they may have made a mistake - given the relative quality of the file they’re currently using. I just don’t think that level of file size is possible without huge distortions and hiss on the file - I’ve managed to produce a 1.5MB file of my 7 mins plus of music, in WAV format, but it sounds terrible!

Reducing the bit depth reduces the dynamic range? less bits = more hiss.
Reducing the sample rate reduces the frequency bandwidth: less samples per second = lower high frequency cut-off = duller sound.

ADPCM provides much better quality than would be expected from only 4 bits per sample, but it’s by no means a “high quality” format.
U-Law, A-Law and the other fancy encodings are generally used for low bandwidth telecommunications where minimal decoding overhead is required - in other words, designed for “telephone quality”.

PCM is the usual standard for high quality audio. 16 bit, 44.1 kHz (44100 samples per second) is the minimum requirement for “full quality” (around 20 Hz to 20 kHz bandwidth, and around -90 dB noise floor). This is the standard that was adopted for CD audio.

For the other options, select “Other uncompressed files” as the format, then click on the “Options” button.
More details here: Audacity Manual

I’d suggest that you get back in touch with the game people

What did they say when you contacted them? Why are you replacing their original track? If theirs “sounded funny” when you may have found out why.

Still waiting to hear back I’m afraid Koz. Theirs sounds fine - if you’re on Facebook, look up the game Fraxinus and see what you think. I can’t see that it is genuinely a 400KB WAV that’s playing in the background there.

The music is very repetitive, so perhaps they are sequencing a series of short audio clips., one for the bass, one for the bell, a couple for the vocal, etc. As a normal 16 bit 44.1 kHz mono WAV file the track would be about 22.7 MB (it’s total duration before repeating is 4:17.385).

Perhaps they don’t want to replace their music. :confused:

What I’ve been told so far is that they ‘bought’ a piece of library music for it, which they are very happy to have replaced. I assumed it was shorted than 4 mins, but didn’t listen carefully to find out. I don’t think it’s playing as short repeated clips of different parts from what I’ve been told. But I have no idea how that can be a 400Kb file either…

For uncompressed audio formats, the file size is easy to calculate:

(bits per sample) x (samples per second) x (channels) x (length in seconds) = number of bits.
number of bits / 8 = number of bytes.

Apart from RAW there is also a little to add on for the “header” and any included metadata.

For example, 4 minutes at 16 bit 44100 samples per second mono:
16 x 44100 x 1 (4 x 60) = 169344000 bits
169344000 / 8 = 21168000 bytes
21168000 bytes is about 20 MB.

Still no further details on the file used, but my contact is adamant that they are using a WAV file that is only 400KB for their game, and that the whole game compiles to 4MB in total. I’m genuinely at a bit of a loss as to how this can be achieved, especially now that someone on here has timed the existing music and reckons it to be close to 4mins in length. That means they’ve managed to produce good quality sound at 100KB per minute, and allegedly still in WAV format. I don’t think even the best compression formats could equal that, let alone whilst still in WAV. I’m genuinely mystified!

I don’t suppose there is any chance that we could see that file?
Analyzing the file with MediaInfo should be able to shed some light on the question.

During my student days I wrote a 4 hour composition that fitted onto a 1.44 MB floppy disk. It was written as a “Tracker” file, and included a “mod player” so that it could be played on any Windows computer with no additional software requirements.

If I can get hold of it Steve, I’ll definitely share! I’ve heard about trackers but never tried that approach myself. I’m not sure their piece of music sounds like it was put together that way - they’re saying they got it from a stock library, I think.

I’m genuinely mystified!

I’m not. I’ve had people give me an “MP3 Wave file.”

People get this stuff turned around all the time, and while it is remotely possible that someone in the gaming community has developed an earth-shaking new technology, those don’t come around very often, and when they do, they remain unsupported niche players for a long time.

MP3 is part of the MPEG1 video standard made available to the public… in 1992. Development started in 1988.

We’ll see.


In comparison, AIFF and RIFF support instruments, markers and loop points in there headers, so no problem to encode sample based sequences. I don’t know what’s all possible with *.wav however.
Audacity seems to make usage of repeating patterns (blocks) too.
However, 400 kB is really too short a file for a whole song.
Has anyone recorded the song and looked on which sample rate the audio is based?

We are waiting for the Poster and the Client to provide a sample file.
I will put many free cups of coffee that either it’s not a WAV, or there’s something else very, very different about it. On the face of it, this job is impossible.


Thanks Koz. I’m with you on that. I’m still waiting to hear more - at the moment no details, just adamant assertions that the file is 400KB and total game size is 800KB. I agree that it may well be an MP3 in disguise. Even then, I’d struggle to get a good quality MP3 of 2-3 minutes of music (someone on here has suggested the current game music file is about 4mins) down to 400KB.

Finally, here we go guys, here’s the link to the piece they’ve used: http://www.premiumbeat.com/royalty_free_music/songs/spiritual-walk
What do we think? Have they maybe used the ‘loops set’ version to make it work somehow, programmed to play in repeated sequences to create a longer track from smaller files, resulting in a much smaller overall file size than if it were one continuous loop?