feat: file recording & improved waveform - #31
Merged
Merged
Conversation
…w, drop scrollbar click-jump
…ck, test all formats
…gin render tests resilient
…e channels without cables
…elled after failed new-mode start
… and settings toggle
…om session counters
…ero; default waveform node size
# Conflicts: # src/routes/virtual-devices/+page.svelte
…d toolbar controls
…bar to bottom block
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 does this PR do?
Three things that hang together around the File Recording node:
1. Append mode for WAV/AIFF. The recording node now has New / Overwrite / Append modes. Append reopens an existing WAV/AIFF and extends it (compressed formats forbid append, and the encoder enforces that). Overwrite-restart is detected via the recorder's
stoppedevent and re-anchors the view at frame 0.2. Shared live canvas waveform (
src/lib/components/waveform_scope.svelte), used by both the Waveform node and the File Recording node. It renders on a single retina-scaled Canvas 2D surface with:maxChannels), and a per-lane minimum height;3. Audio File node playback reliability (playback, not recording):
symphonia-adapter-libopus(symphonia has no first-party Opus codec); the adapter registers a libopus decoder into the symphonia registry, so Opus flows through the same demux/decode path as every other format;Why is this the right approach?
encoders/folder exists because recording needs writing, which symphonia can't do. Playback of WAV/AIFF/FLAC/MP3/AAC/Opus all routes through symphonia. Opus specifically has no first-party symphonia codec, so the third-partysymphonia-adapter-libopusis the least custom code: it plugs into the same registry and gives us seek/duration/EOF for free. The alternative — a hand-written Ogg Opus decoder — was built first and then replaced because it duplicated seek/duration logic the standard path already provides.Checklist
bun run checkpassescargo check --manifest-path src-tauri/Cargo.tomlpassesbun run formatleaves the tree cleansymphonia-adapter-libopus) justified aboveDspWorker::run— all work is in the file-reader thread and the frontendPlatform coverage
114 passed), including format roundtrip (WAV i16/i24/f32, AIFF i16/i24, FLAC i16/i24, MP3, Opus, and AAC on macOS), loop/seek-after-EOF restart, and a truncated-WAV clean-EOF regression test. Played an Audio File and a File Recording through the node graph.Per-OS impact: the reader (
file_reader.rs), decoder registry, and the new format tests are shared across all three backends. The AAC encoder and its test are macOS-only and gated behind#[cfg(target_os = "macos")]; Linux/Windows skip them. Opus, WAV/AIFF/FLAC/MP3 decoding and the recording-modes logic are platform-independent.The CLAP/VST3 plugin render tests were made resilient: a plugin that refuses to load, activate, or pass audio is reported and skipped rather than failing the suite, and the tests skip entirely when no plugins are installed — so CI (which has none) stays green.