Riff / Built on the open web / Media

AnalyserNode

Turns the signal into one heat value and three band levels, every frame.

A post with its tracks listed, and the player bar along the bottom of the screen
The three bars on the playing row and the heat of the filament come from the analyser.

How Riff uses it

The analyser uses a 1024-sample window with 0.6 smoothing. Each frame, the time-domain samples give an RMS that feeds the filament's heat model, and the frequency bins are summed into three bands, bass, voice and air. Those three values scale the three bars on the playing row.

Why

Without it there is no signal to read, so the filament could not follow the music and the bars could not move.

Without it

Same as Web Audio: the bars stay still and the wire breathes on a loop.

Where

Links open the source at the commit this page was published from.

Reference: AnalyserNode on MDN.