Skip to content

Add wavesurfer.js waveform visualization to sample browser#2

Merged
LukeMainwaring merged 3 commits into
mainfrom
waveform-viz
Mar 20, 2026
Merged

Add wavesurfer.js waveform visualization to sample browser#2
LukeMainwaring merged 3 commits into
mainfrom
waveform-viz

Conversation

@LukeMainwaring

Copy link
Copy Markdown
Owner

Summary

  • Add interactive waveform visualization to the sample browser sidebar using wavesurfer.js
  • Replace raw HTMLAudioElement playback with a WaveformViz component that shows a seekable waveform with progress and time display
  • Waveform renders only for the currently playing sample to avoid fetching/decoding audio for every card

Changes

  • frontend/components/waveform-viz.tsx (new) — reusable wavesurfer.js wrapper with theme-aware colors, autoplay, seek-by-click, and time display
  • frontend/components/sample-browser.tsx — replaced new Audio() / audioRef pattern with WaveformViz; card expands to show waveform when playing
  • frontend/package.json — added wavesurfer.js@7.12.4 and @wavesurfer/react@1.0.12

Test Plan

  • Click play on a sample card → waveform appears below metadata, audio plays
  • Click the waveform to seek → playback jumps to that position
  • Click play on a different card → previous waveform disappears, new one appears
  • Let a sample finish → waveform disappears, card returns to normal
  • Click pause on playing sample → playback stops, waveform disappears
  • Verify waveform colors work in both light and dark themes

🤖 Generated with Claude Code

@LukeMainwaring LukeMainwaring merged commit 2659f30 into main Mar 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant