AI sound effects and music for games

By GamesByAI · Published · Updated · 25 sources

On this page

A jump with no sound can feel like a menu transition, and adding a short whoosh is what makes it feel like a jump. AI can now help with both halves of game audio. Your coding agent can write effects as code or generate them from a text prompt, and a few song models handle the music.

Below is where to get each, which plans let you ship what you make, and how to play it in a browser without the silent-on-iPhone bug. The tool facts are as of September 2026 and link to their sources, but terms change a lot, so reread them before a release.

Which AI audio tools allow commercial use?

Paid plans and open licenses do, and most free tiers don’t.

Tool Makes Commercial use Notes
ElevenLabs sound effects Effects up to 30 s, loops Any paid plan, Starter up Free-plan output stays non-commercial, even after upgrading
ZzFX, jsfxr Retro effects from code Yes (MIT, Unlicense) No files; the agent writes parameters
Suno Songs Paid-plan downloads only Downloads capped per month since September 3, 2026
Stable Audio 3.0 Music and effects Free under US$1M annual revenue Small SFX, Small and Medium are open weights
Google Lyria 3.5 Full songs, a couple of minutes Google claims no ownership $0.08 per song, no free tier, SynthID watermark

The table draws on ElevenLabs pricing, ElevenLabs publishing, ZzFX, jsfxr, Suno downloads, Suno terms, Stable Audio 3.0, the Stability license, Lyria, Gemini pricing and Gemini terms.

If you’re wondering where Udio went, it used to be the other big name in AI music, but it turned off downloads on October 29, 2025, the same day it announced its partnership with Universal Music Group (Udio).

Make sound effects in code or from a prompt

For a jam game or a prototype, start with code. ZzFX is a tiny sound generator, MIT-licensed and under 1 KB, where each sound is one line of numbers (ZzFX), and jsfxr recreates the classic sfxr, with presets like pickupCoin (jsfxr).

With ZzFX or jsfxr, a sound is just a list of parameters, so your coding agent can write one and then change it when you ask, as in “make the coin sound higher and shorter”.

Several games in our catalog go all the way with code and ship without a single audio file, according to their READMEs. Hollow Crown builds every sound on the Web Audio API, and Pro Skater: The Warehouse synthesizes all of its audio in code when it starts up.

Realistic material sounds, like wood, glass or rain, are where generating from text earns its keep. ElevenLabs’ sound-effects API returns a clip from 0.5 to 30 seconds, and its default v2 model can even make one that loops smoothly (API).

Name the material, the action and the space. Something like “short wooden crate smash, dry, close, no reverb” gets you further than plain “explosion sound”, and it’s worth generating several takes per sound and keeping the best one.

Before you ship, check the rights. Every ElevenLabs paid plan, Starter included, carries a commercial license, but anything you made outside a paid subscription stays non-commercial, even after you upgrade (publishing help). The use policy also bars using effects “on a standalone basis”, like a sample library you sell (use policy).

Ask for a loop without an intro

Game music repeats, so ask for a loop. A prompt like “90-second loop with no gap at the seam, chiptune, upbeat, no vocals, no intro” works with any of the three models below.

Leave out both, since vocals fight with your sound effects and an intro plays once and then just gets in the way.

Suno makes full songs from a prompt. Its terms limit free-plan output to personal, non-commercial use, so commercial use needs a permitted download on a paid plan (terms). Those terms were revised in August and took effect in September.

Downloads are capped by plan too (Suno), which is worth remembering when you’re trying a bunch of alternate takes.

Suno plan Download cap
Free trial 7 in total
Pro 20 a month
Premier 60 a month

Suno’s help center also says its songs may not be eligible for copyright protection, whatever plan you’re on (Suno help).

Stable Audio 3.0 came out in May 2026, with its Small SFX, Small and Medium models released as open weights, while Large is available through Stability’s API or as an enterprise self-hosted deployment (Stability AI). Under Stability’s community license you own the output and can use it commercially as long as your annual revenue stays under US$1M (license).

Google’s Lyria on the Gemini API has separate models for full songs and short clips (Lyria docs), so pick the one that fits the loop you need.

Model Output length
Lyria 3.5 A couple of minutes, set in the prompt
Lyria 3 Clip Always 30 seconds

The full-song model gives you MP3 by default or WAV if you ask, and it costs $0.08 per song with no free tier (pricing). Every file carries a SynthID watermark, and Google’s API terms say it won’t claim ownership of what you generate (terms).

Music can be code too. Arkanoid Neon generates its synthwave soundtrack live with Web Audio, and ZzFXM writes tracked songs in the same compact style as ZzFX (ZzFXM).

Cybertaxi went the other way. According to its Vibe Jam 2026 submission, its creator tried Suno for music and ElevenLabs for spoken dialog to make the game feel more cinematic.

Start audio on a tap and declare playback on iPhones

Two small things keep your game from going silent. Start audio from the player’s first tap, and on iPhones, declare it as playback. Both fit in one event handler, so it’s really not much work.

Start audio on the first tap

Chrome creates a Web Audio context in a suspended state if nobody has interacted with the page yet, and calling resume() after a gesture starts it (Chrome). A “tap to start” screen takes care of that in every browser.

const ctx = new AudioContext();
startButton.addEventListener('pointerdown', async () => {
  if (ctx.state === 'suspended' || ctx.state === 'interrupted') await ctx.resume();
  if (navigator.audioSession) navigator.audioSession.type = 'playback';
  startGame();
});

That audioSession line is for iPhones, where Web Audio follows the silent switch. Luckily, since iOS 17, setting the session type to playback lets game audio play anyway (WebKit bug).

iOS Safari also moves the context to interrupted when the player switches tabs or turns off the screen, so call resume() again when they come back (MDN).

Ship one audio sprite in two formats

Pack every effect into one file with known offsets, so the game loads all its sounds in a single request. Howler.js is pretty handy here. It plays sprites, falls back to HTML5 audio and unlocks audio on the first interaction by default (Howler).

As for formats, Howler’s README says to default to WebM and fall back to MP3. Safari has played Ogg Opus and Vorbis since 18.4 (WebKit), and if you can only support one format, MDN’s codec guide calls AAC likely the best choice (MDN codecs).

import { Howl } from 'howler';

const sfx = new Howl({
  src: ['/audio/sfx.webm', '/audio/sfx.mp3'],
  sprite: { jump: [0, 180], coin: [250, 300], hit: [600, 220] },
});

const id = sfx.play('jump');
sfx.rate(0.95 + Math.random() * 0.1, id); // a slightly different pitch every time

That rate call plays each copy a little faster or slower than the last, so the fiftieth coin in a minute doesn’t sound exactly like the first. Game feel with AI has a lot more of these small feedback tricks.

Give players the controls

Whatever you ship, players should be able to turn it down.

  • A mute button on screen, reachable during play.

  • Separate volumes for music and effects.

  • Both settings saved in localStorage, so they survive a reload.

  • Audio muted automatically while an ad plays, which Poki requires (Poki requirements).

Keep a sound log

Log every generated file as you make it. One row per file is plenty.

file,tool,plan,date,prompt
sfx/crate.mp3,ElevenLabs eleven_text_to_sound_v2,Starter,2026-09-30,"short wooden crate smash, dry, close, no reverb"

Rights questions tend to show up after launch, when you’ve long forgotten the prompt. Poki, for one, wants developers to be able to show which tools they used and how, with their prompts and iterations, if asked (Poki).

Then tune the feel and pick a portal

Game feel with AI puts a sound for every action at number eleven of its twelve techniques, and where to publish a browser game covers how itch.io, Poki and CrazyGames treat AI-made sound.

The catalog’s rhythm games run on their music, PULSARI Demo among them, silent until a combo earns you the song.

Games to look at

Questions

Can I use AI sound effects in a commercial game?

On a paid plan, usually yes. Every ElevenLabs paid plan, Starter included, carries a commercial license, but content made outside a paid subscription can't be used commercially, even after you upgrade. Its use policy also bars reselling effects on their own, like in a sample pack.

What is the best free way to add sound to a browser game?

Generate it in code. ZzFX is an MIT-licensed sound generator under 1 KB, and jsfxr recreates the classic sfxr tool. Your coding agent can write and tweak their parameters directly, so there aren't any files to manage.

Why doesn't my browser game play sound until I click?

Because browsers block audio until the player interacts with the page. Chrome starts a Web Audio context suspended if it's created before a gesture, so call resume() on the first tap or key press, usually behind a start button.

Can I use Suno music in my game?

Only from a paid plan. Suno's terms, in effect since September 3, 2026, limit free-plan songs to personal, non-commercial use, and commercial use needs a permitted download on a paid plan, which is capped per month. Suno also warns that its songs may not be eligible for copyright protection.

More sources

  1. developer.mozilla.org/en-US/docs/Games/Techniques/Audio_for_Web_Games