AudioWorklet
Code examples and resources for AudioWorklet.
Basic Demo
A minimal AudioWorklet example that passes the input to the output.
Implements a simple one-pole filter with AudioWorklet.
A noise generator with a user-defined AudioParam for amplitude control.
A BitCrusher effect with declarative AudioParam configuration and automation.
Demonstrates two-way messaging between an AudioWorkletNode and its AudioWorkletProcessor.
A volume meter that measures the volume of a microphone input with AudioWorkletProcessor.
Shows how to pass initial data to an AudioWorkletProcessor with AudioWorkletNodeOptions.
Demonstrates how to handle exceptions and errors from an AudioWorkletProcessor.
Advanced Design Pattern
A basic example of how to use WebAssembly in an AudioWorkletProcessor.
A supersaw synthesizer built with C++ and WebAssembly, running in an AudioWorklet. (Google I/O 2019, Audio Developer Conference 2021)
Using a WebAssembly-powered ring buffer to solve the buffer size mismatch problem.
A design pattern for large-scale audio applications that combines AudioWorklet, SharedArrayBuffer, and a Worker.
FreeQueue
A basic example of using FreeQueue for thread-safe communication between a worker and an AudioWorkletProcessor.
Migration from ScriptProcessorNode
A simple audio recording app built with the legacy ScriptProcessorNode.
A simple audio recording app built with AudioWorklet, demonstrating the modern approach to audio processing.
Resources
An introductory article on Audio Worklet by Google Chrome developers.
A blog post on advanced design patterns with AudioWorklet, WebAssembly, and SharedArrayBuffer.
The first conference paper on AudioWorklet, presented at ICMC 2018 by Hongchan Choi.