Commit 8894d4c
fix(export): mix all source audio tracks instead of only the first
The native capture helpers write system audio and the microphone as
separate audio tracks in the recording. The export audio pipeline read
only the demuxer's default (first) track, so a recording made with both
system audio and mic enabled exported with just the system-audio track —
pure silence when nothing was playing, dropping the user's voice
entirely.
- Trim-only path: enumerate all audio streams via getAVStreams(), decode
each one (readAVPacket per stream index), and sum them into a single
mixed timeline, re-chunked at the same granularity the single-track
path uses for trim skipping. Falls back to the existing default-track
path for single-track sources.
- Pitch-preserved (media element) path: enable every audio track on the
render element, mirroring what the editor preview already does.
Adds a browser-mode regression test with a two-track fixture (silent
first track + 440Hz tone second track) that exports through the real
WebCodecs pipeline and asserts the result is audible; it fails with
peak=0 on the previous code.
Known remaining gap (intentionally out of scope): the source-copy fast
path returns the source verbatim (all tracks preserved), and the offline
WSOLA path (>16x speed) still reads the default track only.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent c2ba750 commit 8894d4c
3 files changed
Lines changed: 379 additions & 48 deletions
File tree
- src/lib/exporter
- tests/fixtures
0 commit comments