Skyfall ships with no audio files at all — no .mp3, no .wav, nothing in the network tab when a shot fires. Every gunshot, hit, miss, combo chime, power-up jingle, and boss fanfare is built at the moment it plays, entirely inside js/sound.js, using the browser's own Web Audio API. That wasn't a stunt; it was the simplest way to solve a handful of real problems at once.

Why synthesis instead of samples

Recorded sound effects mean licensing questions, file weight, and a loading step before the first sound can play. A synthesized sound engine sidesteps all three: there's nothing to license because nothing was recorded, there's nothing to download because there's nothing to fetch, and the very first shot of a brand-new session sounds identical to the thousandth — no missed downloads, no silent fallback. The entire sound engine, every effect included, is a few kilobytes of code that was already being downloaded as part of the game anyway.

How a single sound is actually built

Two lower-level building blocks do almost all the work. One generates a short burst of white noise by filling an audio buffer with random samples — that's the raw material behind percussive, non-tonal sounds like the gunshot, which runs that noise through a bandpass filter centered around 1800Hz to shape it into something that reads as a "crack" rather than static. The other is a small envelope helper that ramps a sound's volume up quickly and back down on an exponential curve — the same attack/decay shaping a synthesizer uses, just applied directly to a Web Audio gain node. Almost every effect in the game is one of those two primitives — noise or a plain oscillator — pushed through a short envelope and, for some sounds, a filter.

From there, each effect is really just a distinct combination of oscillator type, frequency, and timing. A hit is a short, bright tone; a miss is a lower, duller one; the combo bonus and power-up pickup are quick ascending note sequences rather than a single tone, which is what makes them read as "reward" sounds instead of neutral feedback; the boss-down fanfare stacks a few oscillators together for a fuller, more triumphant chord than any single in-round hit gets. None of it touches a sample library — it's all oscillators and gain envelopes, scheduled in real time against the Web Audio clock.

Why this matters for players: the audio context only initializes on your first interaction with the page (a browser requirement, not a choice we made), which is why sound "unlocks" the moment you press start rather than the moment the page loads — and why muting is instant with no buffered audio left to bleed through.

The trade-off is real: synthesized effects can't match the texture of a well-recorded sample, and building a satisfying "crack" out of filtered noise takes more tuning by ear than dropping in a pre-made file would. For a browser game built with zero external assets, though, it means the audio scales with the rest of the project — no asset pipeline, no format conversion, no licensing footnote required anywhere on the site.

More from the blog: read Why we built Skyfall without a build tool for the same zero-dependency philosophy applied to the rest of the codebase, or head back to the Blog index.