The Lab - Web Audio

Oscilloscope

Your microphone, drawn as a moving waveform. Everything runs in your browser - no audio leaves this page.

How it works

The microphone feeds a MediaStreamAudioSourceNode, which pipes into an AnalyserNode with fftSize = 2048. Every animation frame, getByteTimeDomainData() copies 2048 amplitude samples into a typed array, and a canvas draws them as one polyline. The horizontal axis is time, the vertical axis is amplitude - the same time-domain view a real scope shows a probe.

The production version of this toy lives on this site's 404 page. The trick that makes it feel analog is drawing the trace with a slight afterimage: each frame paints a translucent black rectangle instead of clearing, so the old trace decays like phosphor.