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
useWaveform(url, { ...waveformPresets.chat, barCount: 40 })
resample(peaks, 40, { metric: 'peak' })
normalize(resample(peaks, 40), { scale: 'db', reference })
resample(peaks, 40) // not normalized
Reading — 63 s
resample(peaks, 120) // waveformPresets.player
resample(peaks, 120, { start: 20, end: 30 })
Music — 35 s
resample(peaks, 120)
resample(peaks, 120, { metric: 'peak' })
normalizeMinMax(resampleMinMax(peaks, 360))
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.