Music Tech3 min read

The Web Audio API, Explained for Musicians

How browsers actually process audio — the audio graph, AudioWorklets, sample-accurate scheduling, and why browser DAWs became viable.

Browser DAWs stopped being toys because of the Web Audio API — specifically its audio graph and, since AudioWorklets, its ability to run custom processing on a dedicated real-time thread.

The audio graph

Web Audio models sound as a graph of connected nodes, which maps almost exactly onto how a mixing desk works:

  • Source nodes produce sound — an oscillator, a sample player, a microphone input.
  • Processing nodes modify it — filters, gain, compression, delay, convolution reverb.
  • The destination node is your speakers.

You connect them: oscillator → filter → gain → destination. That is a synth voice with a filter and a volume control. Chain more nodes and you have an effects rack. The routing flexibility is genuinely comparable to a DAW's, because it is the same concept.

Sample-accurate scheduling

The critical feature for music is that Web Audio events are scheduled against the audio clock, not JavaScript timers.

This matters more than it sounds. JavaScript's setTimeout is imprecise and gets delayed whenever the browser is busy — if you sequenced drums with it, the timing would drift audibly. Web Audio lets you say "start this sound at exactly 4.25 seconds on the audio clock," and it happens at that sample, regardless of what the interface is doing.

The standard technique is look-ahead scheduling: a timer wakes periodically, looks a fraction of a second into the future, and schedules every event in that window precisely. The result is rock-solid timing from an imprecise timer.

AudioWorklets

The original way to write custom processing was ScriptProcessorNode, which ran on the main thread — the same thread as the interface. Any UI work could interrupt audio and cause a click.

AudioWorklet fixed this. Custom code runs on the dedicated audio rendering thread, isolated from the interface. This is why a modern browser DAW can run custom effects while you drag things around without glitching, and it is the single change most responsible for browser DAWs becoming credible.

WebAssembly

Alongside AudioWorklets, WebAssembly lets audio code written in C++ run in the browser at near-native speed. Decades of existing DSP code — synthesis engines, effect algorithms, codecs — can be compiled to WebAssembly and run in a web app. Much of what makes a browser DAW sound professional is compiled C++ audio code, not JavaScript.

What's still harder in the browser

Being honest about the limits:

  • Latency is higher than a native DAW with ASIO or Core Audio. Fine for arranging and mixing; a real consideration for tracking a live performance.
  • Plugin ecosystem — your VST collection does not run in a web page by default, though some tools bridge this.
  • Memory — the browser's memory model is more constrained than a native application's.
  • Offline reliability — a connection interruption is a class of failure native DAWs don't have.

Why this matters

The practical consequence is that "browser-based" no longer implies "limited." A tool like Veena runs a full multitrack DAW — timeline, MIDI editor, mixer, instruments, effects — in a browser tab, because the platform now supports it properly.

The tradeoff that remains is latency, which is why browser DAWs are strongest for writing, arranging, editing, and mixing, and weakest for tracking live instruments.

Related reading: WebAssembly in browser DAWs, browser audio latency explained, and browser-based DAW guide.

Frequently asked questions

What is the Web Audio API?

It is the browser's built-in audio processing system. It lets web applications generate, process, and route audio through a graph of connected nodes — oscillators, filters, gain stages, effects — with sample-accurate timing, which is what makes browser-based DAWs possible.

Is browser audio as good as native audio?

Sound quality is identical — both process 32-bit float audio at the same sample rates. The differences are latency, which is higher in the browser, and plugin ecosystem, which is smaller.

What is an AudioWorklet?

An AudioWorklet runs custom audio processing code on the browser's dedicated audio thread, separate from the main thread that handles the interface. It replaced the old ScriptProcessorNode and is what allows browser DAWs to run custom effects without glitching when the UI is busy.

Start making music in Veena

Free, browser-based, no downloads required.

Try Veena Free