Repository navigation
Play soundtrack tracks and Sound picker previews through a scrubbable waveform - #31
Merged
Merged
Conversation
… waveform The two places GVC plays audio, each soundtrack card and the Sound picker's preview, now use a waveform you can click or drag to seek, with a play/pause button and a time readout, in place of <audio controls>. WaveformPlayer is GAM's player (davior/gam#54), ported without what only GAM needs, with colours that follow the light/dark theme, and with a compact size for the soundtrack cards. The peaks come from GAM, which already computes and caches them, through a new GET /api/gam/assets/{id}/peaks proxy as the signed-in user, like every other GAM read. That call gets a 120 s timeout, because GAM decodes a long recording on its first view. A GAM that has no waveform (including one older than gam#54) gives a 422, and the player scrubs on a flat line. Soundtrack cards still don't load their audio until played. GAM's measured duration fills the readout and makes the waveform scrubbable before then. Recorded as GAM-9 in the plan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1geD3VLg4aqTvHVuRLA53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The two places GVC plays audio now use a waveform you can click or drag to seek, with a play/pause button and a time readout, instead of the plain
<audio controls>:How
Frontend.
WaveformPlayeris GAM's player from davior/gam#54, ported without the clip window and outside control that only GAM needs.<audio>element is still the player, minus its native controls, and wavesurfer.js draws over it.preload="none". GAM's measured duration fills the readout and makes the waveform scrubbable before the audio has loaded.Backend.
GET /api/gam/assets/{id}/peaksproxies GAM's cached waveform as the signed-in user, like every other GAM read, so CORS and GAM-5 aren't involved.waveform_unavailable, and the player keeps a flat line that still scrubs. This includes a GAM older than gam#54, which answers 404.gam_unavailable/gam_rejected_session.Recorded as GAM-9 (done) in
docs/plan-of-attack.md.Testing
pytest -q: 758 passed. New tests intest_gam_api.pycover peaks passed through with the caller's token, a GAM 422 or 404 givingwaveform_unavailable, and a GAM 5xx givinggam_unavailable.npm test: 199 passed. The newWaveformPlayer.test.tsxcovers:<audio>;The existing Soundtrack and picker tests stub the peaks call.
lint, Prettier andbuildare clean.0:00 / 0:40before any audio has loaded;<audio>src is never reset, and wavesurfer makes no media fetches.Generated by Claude Code