# WAV files in browser games

## WAV gives the cleanest starting point for game sound, but it's big: on Go Bananas, a WAV must fit in 5 MB, and the site turns it into an MP3.

WAV is an uncompressed audio format. It stores every sample exactly as recorded, so nothing is lost, but the files are large: CD-quality stereo takes about 10.6 MB per minute. Most audio editors, recorders and sound-effect libraries can export WAV.

## What WAV is good for in games

WAV is a great source format for **short sound effects**. A jump, a coin or a click lasts a second or two, so even uncompressed it's small, and because it hasn't been compressed before, the conversion starts from the best possible audio.

For **music**, WAV is usually the wrong choice to upload. A track of more than about half a minute in stereo is over the 5 MB limit. Export music as MP3, M4A or OGG instead.

On Go Bananas, every audio upload is turned into an MP3, so your game never plays the WAV itself. The format you start from decides how clean the audio is going in and whether the file fits the 5 MB limit. A WAV wins on quality, and loses on size.

## Uploading WAV to Go Bananas

You upload audio in the **Upload Asset** window. Open it from the **Assets** tab ("Upload Asset") or from the editor ("Upload New", or drag a file onto the editor chat). If you drop an audio file on the create panel, the site opens the same window for you.

You need to be signed in with a verified email. Before the upload, you tick a box confirming you have the right to use the audio: it's your own work, it's licensed to you, or it's in the public domain.

| Limit | Value |
| --- | --- |
| File size | 5 MB per file |
| Length | 120 seconds |
| All your audio together | 50 MB per account |
| Embedded tags | 256 KB |

The site checks the file is a real WAV it can read, then prepares it for games:

1. It sets the loudness to -16 LUFS, so every sound in a game plays at a similar level.
2. It trims silence at the start of the file. Silence at the end stays.
3. It removes all metadata.
4. It saves the result as an MP3 at 44.1 kHz. A clip of 5 seconds or less is treated as a sound effect and saved in mono at 96 kbps. A longer clip is treated as music and saved in stereo at 128 kbps.

The WAV itself isn't kept, only the MP3 made from it. The site warns you if the audio is clipping (distorted) or unusually quiet or loud. You can trim it to the part you want, and games then play only that part. The file isn't cut, so you can change the trim later.

## Using WAV in your game

**The easy way: ask the AI.** In the create or edit box, type `@` and pick your sound. Its name is inserted in quotes, for example `"laser"`, and the AI knows which file you mean. In the editor's **Assets** tab, attach the sound to your game to set its volume with a slider from 0 to 100.

**In code.** Every game has a sound helper, `window.__audio`. Your sound's address is in `window.GAME_ASSETS.audio`, under the file's name without its extension. The address points to the MP3 the site made from your WAV:

```js
const laserUrl = window.GAME_ASSETS.audio['laser'].url;

// Browsers, and iPhones especially, only allow sound after a tap or click
document.addEventListener('pointerdown', () => __audio.init(), { once: true });

// Load early, so the sound is ready the first time it's needed
__audio.load(laserUrl);

function fire() {
  __audio.play(laserUrl, { volume: 0.7, rate: 0.9 + Math.random() * 0.2 });
}
```

Changing `rate` a little on each play keeps a sound that repeats often from getting tiring. For music, use `__audio.playMusic(url, { loop: true })`. For 3D games, `__audio.play3D(url, x, y, z, camera)` makes a sound come from a point in space.

Pass the full address: a bare name or an asset ID won't play. Use the helper rather than `new Audio()` or your own `AudioContext`. It unlocks sound on iPhones, follows the site's mute button, and applies the volume you set in the editor.

## Built-in sounds

Every game can also use a free sound pack, released as CC0 (no permission or credit needed). Each sound lives at `https://gobananas.co/sfx/<name>.mp3`:

- `gunshot`, `reload`, `hit`, `footstep`, `pickup`, `menu_click`
- `zombie_moan`, `zombie_attack`, `zombie_death`
- `ambient_tension`, a music loop of about 10 seconds

Use the full https address in game code. The editor's volume slider doesn't apply to these sounds, so set their volume in the `play` call.

## Tips and common problems

- **How much fits in 5 MB.** At 44.1 kHz and 16 bits, stereo takes about 10.6 MB per minute, so 5 MB holds about 28 seconds. Mono holds about twice that, about 56 seconds. A 24-bit or 48 kHz export is bigger still.
- **Export short effects as mono.** A sound effect is saved in mono anyway, so a mono WAV halves the upload size and loses nothing.
- **The file is too big.** Shorten it, export it in mono, or convert it to MP3 before uploading.
- **Silence at the end.** Only the start is trimmed. Trim the end in the editor, or cut it in your audio editor.
- **A clipping warning** means the recording is distorted at its loudest moments. Lowering the volume later won't fix it; re-export from the original at a lower level.
- **The game can't find the sound.** Its name in `GAME_ASSETS.audio` is the file name without `.wav`. If you rename the asset, game code that uses the old name stops finding it. If two files have the same name, the newest one wins.

## From ChatGPT or Claude

Audio can't be sent through the Go Bananas app in ChatGPT or Claude. Ask for an upload link: it takes you to your game's page, where you upload the file from the editor.

## Related

- [MP3 files in browser games](/formats/mp3)
- [OGG files in browser games](/formats/ogg)
- [M4A files in browser games](/formats/m4a)
- [All file formats](/formats)
- [Adding sound and music to a game](/guides/sound-and-music)
- [How to make a video game](/guides/how-to-make-a-video-game)
- [Making games that work on phones](/guides/games-on-phones)
