Game audio formats and file size budgets: WAV, OGG, mono vs stereo and loop lengths
Free kit: Free Cozy Audio kit bundles this with the other tools you need.
Audio is often the largest part of a small game's download after art, and it is easy to waste space without noticing. A three-minute soundtrack saved as uncompressed stereo WAV takes over 30 MB, and a few of those add up fast on web builds and mobile. This guide covers which formats to use for which sounds, how to calculate sizes before you export, and how to cut music loops that repeat without a gap.
Engines differ, so check your engine's documentation (Godot, Unity, GameMaker, or your web audio library) for the exact import options it supports.
The size formula
Uncompressed size in bytes per second = sample rate x bit depth x channels / 8.
Stereo music, 44.1 kHz, 16-bit:
- 44,100 x 16 x 2 / 8 = 176,400 bytes per second
- A 3-minute track: 176,400 x 180 = 31,752,000 bytes, about 31.8 MB
Same track compressed at 160 kbps (Ogg Vorbis or MP3):
- 160,000 bits / 8 = 20,000 bytes per second
- 20,000 x 180 = 3,600,000 bytes, about 3.6 MB
That is less than one eighth of the size. The audio file size chart shows common combinations, and the MP3 file size calculator handles any bitrate and length.
Which format for which sound
Short sound effects (jumps, hits, UI blips): WAV or another uncompressed format.
Short files are small anyway, and uncompressed audio needs no decoding, which helps when many sounds play at once.
Music and long ambience: Ogg Vorbis (or the compressed format your engine prefers).
Ogg Vorbis is widely supported in game engines and has no licensing fees. Many engines can stream long files from disk instead of loading them fully into memory.
MP3: usable, with a loop caveat.
MP3 encoders typically add a small amount of silence at the start and end of a file. Unless your engine handles the encoder's gap information, a looping MP3 can have a short gap. For looping music, Ogg or WAV is usually safer.
Mono vs stereo
- Mono halves the size and is the usual choice for sound effects that will be positioned in a 2D or 3D world. Many engines expect mono sources for positional audio.
- Stereo makes sense for music, ambience beds and UI sounds that are meant to feel wide and are not tied to a point in space.
Example: 40 sound effects, each 0.5 seconds, 44.1 kHz, 16-bit mono
- 44,100 x 16 x 1 / 8 = 88,200 bytes per second
- 0.5 seconds = 44,100 bytes per effect
- 40 effects = 1,764,000 bytes, about 1.8 MB
In stereo, the same set would be about 3.5 MB.
Setting an audio budget
Decide on a total before you start producing. For a small web game, you might choose something like this (an example, not a rule):
| Category | Count | Format | Approx. size |
|---|---|---|---|
| Music loops | 3 x 60 s | Ogg 128 kbps stereo | 3 x 0.96 MB = 2.9 MB |
| Ambience | 2 x 30 s | Ogg 96 kbps stereo | 2 x 0.36 MB = 0.7 MB |
| Sound effects | 40 x 0.5 s | WAV 16-bit mono | 1.8 MB |
| Total | | | about 5.4 MB |
The music line: 128,000 / 8 = 16,000 bytes per second x 60 = 960,000 bytes per loop. Ambience: 96,000 / 8 = 12,000 x 30 = 360,000 bytes.
Cutting a music loop to an exact length
A loop that repeats cleanly must be an exact number of bars long. Length in seconds = bars x beats per bar x 60 / BPM.
Example: 8 bars of 4/4 at 120 BPM
- 8 x 4 = 32 beats
- 32 x 60 / 120 = 16 seconds
- At 44.1 kHz: 16 x 44,100 = 705,600 samples
Export exactly that length. Many DAWs let you set the export range in bars, which avoids rounding. The sample length calculator converts bars and BPM to seconds and samples.
To avoid a click at the loop point, make sure the end flows into the start: reverb and delay tails that spill past the last bar should be captured and mixed back into the beginning of the loop. The seamless loops guide covers this in detail.
Intro plus loop
A common music setup is a short intro that plays once, then a loop that repeats. Export them as two files (or set a loop start point if your engine supports one), so the intro does not replay every cycle.
Export checklist
1. Keep one sample rate for the whole project.
2. Trim silence at the start of sound effects so they fire instantly.
3. Normalize effects to consistent levels before export, then fine-tune in the engine.
4. Name files clearly: `sfx_jump_01.wav`, `mus_level1_loop.ogg`.
5. Keep uncompressed masters outside the game build so you can re-export later.
For making the effects themselves, see adding retro sound effects to a small game.