AudioWorklet

Code examples and resources for AudioWorklet.

Basic Demo

Hello Audio Worklet!

A minimal AudioWorklet example that passes the input to the output.

One Pole Filter

Implements a simple one-pole filter with AudioWorklet.

Noise Generator with AudioParam

A noise generator with a user-defined AudioParam for amplitude control.

BitCrusher with AudioParam

A BitCrusher effect with declarative AudioParam configuration and automation.

MessagePort

Demonstrates two-way messaging between an AudioWorkletNode and its AudioWorkletProcessor.

Volume Meter

A volume meter that measures the volume of a microphone input with AudioWorkletProcessor.

AudioWorkletNode Options

Shows how to pass initial data to an AudioWorkletProcessor with AudioWorkletNodeOptions.

Handling Errors

Demonstrates how to handle exceptions and errors from an AudioWorkletProcessor.

Advanced Design Pattern

Audio Worklet and WebAssembly

A basic example of how to use WebAssembly in an AudioWorkletProcessor.

WebAssembly Supersaw

A supersaw synthesizer built with C++ and WebAssembly, running in an AudioWorklet. (Google I/O 2019, Audio Developer Conference 2021)

Ring Buffer in AudioWorkletProcessor

Using a WebAssembly-powered ring buffer to solve the buffer size mismatch problem.

Audio Worklet, SharedArrayBuffer, and Worker

A design pattern for large-scale audio applications that combines AudioWorklet, SharedArrayBuffer, and a Worker.

FreeQueue

Simple Passthrough

A basic example of using FreeQueue for thread-safe communication between a worker and an AudioWorkletProcessor.

Migration from ScriptProcessorNode

ScriptProcessorNode Recorder

A simple audio recording app built with the legacy ScriptProcessorNode.

AudioWorklet Recorder

A simple audio recording app built with AudioWorklet, demonstrating the modern approach to audio processing.

Resources

Enter AudioWorklet

An introductory article on Audio Worklet by Google Chrome developers.

AudioWorklet Design Pattern

A blog post on advanced design patterns with AudioWorklet, WebAssembly, and SharedArrayBuffer.

AudioWorklet - The future of web audio

The first conference paper on AudioWorklet, presented at ICMC 2018 by Hongchan Choi.