Interactive Web Audio Tutorial

Explore the Web Audio API interactively! This example demonstrates a connected audio graph with real-time visualization. Press Play to start the audio context and hear sound flow through the nodes.

View source on GitHub

AudioContext

OscillatorNode

The fundamental sound source. Choose a waveform type, set the frequency in Hz, and fine-tune with detune in cents.

BiquadFilterNode

Shape the tone with various filter types. frequency sets the cutoff, Q controls resonance, and gain boosts or cuts frequencies.

StereoPannerNode

Position the sound in the stereo field. pan ranges from -1 (full left) to 1 (full right).

DynamicsCompressorNode

Reduces loud sounds and boosts quiet ones. threshold sets where compression begins, ratio controls intensity.

GainNode

Controls amplitude (volume). The gain value multiplies the signal: 0 = silence, 1 = full volume.

AnalyserNode

Provides real-time frequency and time-domain analysis data for visualization. The waveform below shows the audio signal.

AudioDestinationNode

The final output node representing the speakers or audio output device.