How a Browser Tab Makes Arcade Sound With No Audio Files

Open one of our games and tap a pad. That pop you hear? It was never a file. Break a brick and the crunch it makes wasn't recorded either. Clear a round and three notes climb out of the speaker, and those weren't sitting in a folder waiting to play. There is no pop.mp3 on our server, no folder of sound effects, nothing to download and decode. Every noise in these games is built the instant it plays, out of arithmetic, by one small file that ships with the page.
That file is sfx.ts, and its top comment is blunt about the goal: "All effects are synthesized with the Web Audio API. No audio files." This is the story of how that works, and why a random tap in Echo still comes out sounding like music.
An oscillator is a tone generator you can bend
The Web Audio API gives the browser a tiny modular synth. The piece we lean on hardest is the oscillator: feed it a frequency and a waveform (sine, square, triangle, sawtooth) and it produces a pure tone. On its own that is a flat, ugly beep. The character comes from what you do to it over the next tenth of a second.
Our whole effects engine is basically one helper function wrapped around an oscillator. It creates the tone, routes it through a gain node (a volume control), and then draws a fast envelope on that volume: ramp up to full in six milliseconds, then decay back down to near silence over the length of the sound. That sharp attack and quick fade is the difference between a beep and a pop. The ear reads the shape, not just the pitch.
A bounce is almost the whole recipe at its simplest: a 300 Hz square wave that lasts 50 milliseconds and then stops. That is a paddle hit. Nothing more to it.
Pitch is the cheapest variety trick we own
A handful of numbers buys a surprising amount of feel here. Most of our effects take a pitch or a combo argument, and they use it to move the frequency around so the sound is never quite the same twice.
The point pickup climbs with your streak: its base frequency is 360 + combo × 55, capped so it does not screech, and while it plays it glides upward to a brighter target. Rack up a chain and each grab sits a step higher than the last, so the audio itself tells you the run is heating up before you have read a single number. A target pop scales the same way by intensity. Breaking a brick pitches its tone by which row you hit, so a wall coming apart sounds like a scale, not a stutter.
That upward glide is a second oscillator trick. Instead of holding one frequency, we tell it to slide exponentially from a start pitch to an end pitch across the life of the sound. A pickup whooshing up. A lost life sagging from 500 Hz down to 120. The slab in a stacker thudding from 200 down to 120. Same mechanism, different directions, completely different emotional read.
The other half of the sound is noise
Pure tones cannot make a crunch or a hiss. For those we generate a short burst of white noise by filling a buffer with random numbers, fading it out linearly, then running it through a bandpass filter so it sits at a chosen frequency instead of hissing across the whole spectrum. Breaking a brick fires a tone and a noise burst at once. The tone gives it a pitch; the noise gives it grit. Together they read as something shattering.
Game over stacks both ideas: three sawtooth notes falling from 420 to 330 to 220 Hz, spaced out in time so they land as a little descending phrase, with a low filtered noise burst underneath for the thud. You have heard that "you died" shape a thousand times in arcades. We wrote ours as a falling three-note figure with a filtered thump under it.
Echo's four pads are a chord
Echo is where synthesis stops being a cost-saving measure and becomes the actual design. It is Simon: watch four pads light in sequence, tap them back, one longer each round. The catch with a memory game is that the sequence is random, and random notes usually sound like a wrong-number phone.
So the four pads are not arbitrary. They ring out at 261.63, 329.63, 392.0 and 440.0 Hz. Those are C4, E4, G4 and A4, the four tones of a C major sixth chord. Every note the game can possibly play belongs to the same chord, which means there is no order the randomizer can pick that clashes. Whatever sequence it hands you resolves as a small, consonant melody. A clean run is, quietly, you performing a tune you did not write.
When you miss, we throw that consonance away on purpose. A wrong tap fires two detuned tones eight Hz apart, 150 and 142 Hz, so they beat against each other into a sour buzz, and then the descending game-over phrase drops. The music breaking is the punishment. We built the reward and the penalty out of the same tool, pointed in opposite directions. We wrote more about the feel of that game in the Echo memory guide.
music.ts: a whole synthwave track, stored nowhere
Sound effects are one-shots. Background music is harder, because it has to keep perfect time forever without a backing track to lean on. That lives in a second file, music.ts, and it runs a generative arrangement: driving bass, a hypnotic arpeggio, a warm pad, punchy drums. All of it synthesized, looping, and stored nowhere.
The timing uses the classic look-ahead scheduler, sometimes called the "two clocks" pattern. A cheap timer wakes up every 25 milliseconds and asks a precise question: which notes are due in the next fraction of a second? It schedules those directly on the audio clock, which is sample-accurate, then goes back to sleep. Your game can stutter a frame and the groove stays locked, because the beat was booked ahead of time on a clock that never drifts.
Each game gets its own theme, a small bundle of numbers: a tempo, four chords, a waveform for the lead and one for the bass, and a couple of feel knobs for brightness and swing. Nova runs a bright, pulsing C minor at 128 BPM with a sawtooth lead. Aura Dash is tenser and faster, an A minor progression at 134. Echo's music is warmer, a C-major feel at 112 with a sine lead, to match the pads. From those few values the scheduler builds the bass line, spreads each chord into a two-octave arpeggio one sixteenth-note at a time, and lays a kick on every beat. The pad even detunes two sawtooth oscillators a few cents apart to get that wide, seasick analog shimmer, no sample required.
The mix is deliberate. The music sits at about half the volume of the effects, so a pop always cuts through the track underneath it.
Why do it the hard way
We could have bought a sound pack. Plenty of studios do. But a pack is weight to download. It is a network request that can fail on a bad connection. And it hands you a fixed set of clips, none of which you can bend per combo. Synthesis costs a few kilobytes of code instead, and it gives us a pitch dial on every effect, music that starts the instant you press play, and a game like Echo whose core idea is the audio. It is the same reason we keep the whole library small and built by hand: when we own every layer down to the waveform, we can go back and sweat it.
Turn the sound on next time. It is not decoration bolted to the side. In these games, it is doing math in real time, and it is part of the game.
Frequently asked questions
Do the games really ship with no sound files at all?+
Correct. There is not a single .mp3, .wav or .ogg in the games. Every effect and every note of music is generated in your browser at the moment it plays, using the Web Audio API. The total download cost of all our audio is a few kilobytes of code.
Why does Echo sound like a tune when the sequence is random?+
Because the four pads are tuned to C4, E4, G4 and A4, which together form a C major sixth chord. Every note the game can play belongs to the same chord, so any order it fires still lands as a consonant little melody instead of a clash. The randomness picks the order; the tuning guarantees it stays musical.
Does synthesizing sound live slow the game down or drain battery?+
Barely. A single effect is one or two oscillators running for a tenth of a second, then discarded. The Web Audio API runs on its own audio thread, so it does not fight your game loop for frames. It is far lighter than streaming and decoding an audio file would be.
Can I mute it?+
Yes. Every game has a speaker button, and the setting is shared. One toggle silences both the sound effects and the background music at once, and the preference is remembered the next time you play.



