Skip to content

fix(recording): silent recordings — capture + mux audio correctly - #6

Merged
slaveofcode merged 1 commit into
developfrom
fix/recording-audio
Jul 21, 2026
Merged

fix(recording): silent recordings — capture + mux audio correctly#6
slaveofcode merged 1 commit into
developfrom
fix/recording-audio

Conversation

@slaveofcode

Copy link
Copy Markdown
Owner

Summary

Screen recordings came out silent (video-only stream, confirmed via ffprobe). Two root causes:

  1. Audio flags dropped in IPCTauriCaptureService.startRecording forwarded only format/fps/displayId/bounds, so includeAudio/systemAudio never reached Rust and the AudioRecorder was never started. Now forwarded.
  2. Wrong mux codec for WebM — the mux always used -c:a aac, but the default output is WebM, which can't hold AAC (needs Opus). The mux failed → video-only file. Now picks by container: mp4 → aac, webm → libopus.

Also fixes a build break

The [lints.rust] check-cfg = ['cfg(cargo-clippy)'] form (added in #5) is invalid on current rustc — cargo build errors with invalid --check-cfg argument. CI's rustc was lenient so it slipped through. Switched to unexpected_cfgs = "allow".

Testing

  • macOS builds clean (0 warnings); 385 JS tests pass.
  • ⚠️ Needs a mic-enabled recording on hardware to confirm audio actually lands in the file (the code path is now correct; whether avfoundation :0 captures your mic is the runtime check).

🤖 Generated with Claude Code

Two bugs made every recording come out silent:
1. TauriCaptureService.startRecording dropped includeAudio/systemAudio before
   the IPC call, so Rust never started the AudioRecorder. Now forwarded.
2. The mux always used -c:a aac, but WebM (the default output) can't hold AAC —
   it needs Opus, so the mux failed and left a video-only file. Pick the audio
   codec by container: mp4 → aac, webm → libopus.

Also fixes a build break: the [lints.rust] check-cfg form added earlier is
invalid on current rustc (errored with "invalid --check-cfg argument"); switched
to `unexpected_cfgs = "allow"`.

macOS builds clean (0 warnings); 385 JS tests pass. Needs a mic-enabled recording
on hardware to confirm audio lands in the file.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013dqouzFP8vy9jaKhTDFj5H
@slaveofcode
slaveofcode merged commit b981189 into develop Jul 21, 2026
6 checks 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