Decodes an audio file into peak data and renders it as a bar waveform on canvas. Click or drag to seek. Includes play/pause, speed toggle (0.5x-2x), and a volume slider. Shows current time and duration. Falls back to a sine silhouette if decoding fails.
waveform-scrubber-preview
Generating audio...
Why it helps: A waveform scrubber gives users precise visual control over audio playback. The bar-based visualization makes it easy to identify sections of a track, and the speed/volume controls add a complete mini-player experience.
Also good to know:
// Loading source...
import { WaveformScrubber } from "@/components/live/WaveformScrubber";
<WaveformScrubber
src="/audio/track.mp3"
title="Demo track"
subtitle="Click the waveform to seek"
accent="#ff7a2f"
showSpeed={true}
showVolume={true}
/>Audio URL. Must be same-origin or CORS-enabled.
Title shown above the waveform.
Subtitle shown above the waveform.
Height of the waveform canvas in px.
Number of bars in the waveform.
Accent color for the played portion.
Color of the unplayed portion.
Show the speed toggle row.
Show the volume slider.
Start playing automatically when in view.
Called when the audio ends.
import { WaveformScrubber } from "@/components/live/WaveformScrubber";
<WaveformScrubber
src="/audio/track.mp3"
title="Demo track"
subtitle="Click the waveform to seek"
accent="#ff7a2f"
showSpeed={true}
showVolume={true}
/>