SonicFrame v1.3.2

Live frequency

While the sound plays, the bars dance to its spectrum, through Web Audio, in up to 512 bands. When it stops, the wave comes back.

Adding it

import { liveFrequency } from 'sonicframe';

frame.use(liveFrequency({ bands: 48 }));

Press play to see it move.

Options

Option Default What it does
fftSize 512 The analyser's window, a power of two up to 2048.
smoothing 0.8 How much each frame leans on the last (0 to 0.99).
minHz, maxHz 40, 16000 The frequency range across the bars, in Hz: from at least 1 to at most half the sample rate. Anything that is not a number is the default.
bands 48 How many bands of the spectrum feed the bars, at most 512.

Never silences a sound

A media element from another origin without CORS cannot be read without muting it. SonicFrame refuses it with an error instead, and the sound keeps playing. The page's shared audio context is never closed, nor its output disconnected.

Motion These bars move with the sound, so leave the plugin out for people who asked for less motion if it is only decoration.