Skip to main content

Examples

Every waveform on this page is computed from a real recording by the library itself: the C++ core analyzed the audio, and the JS display functions turned the result into SVG paths when this site was built. The recordings are in the public domain (sources).

Voice message — 12 s of speech​

waveformPresets.chat
useWaveform(url, { ...waveformPresets.chat, barCount: 40 })
peak metric
resample(peaks, 40, { metric: 'peak' })
decibel scale
normalize(resample(peaks, 40), { scale: 'db', reference })
raw levels
resample(peaks, 40) // not normalized

Reading — 63 s​

Overview, waveformPresets.player
resample(peaks, 120) // waveformPresets.player
Seconds 20–30
resample(peaks, 120, { start: 20, end: 30 })

Music — 35 s​

RMS
resample(peaks, 120)
Peak
resample(peaks, 120, { metric: 'peak' })
Signed envelope
normalizeMinMax(resampleMinMax(peaks, 360))
Signed envelope, seconds 10–12
resampleMinMax(peaks, 360, { start: 10, end: 12 })

Example apps​

The repository contains a bare React Native app and an Expo app with the same demo: a chat bubble drawn with the chat preset, and a full waveform with every knob — bar count, metric, scale, reference and zoom — that never decodes again.