diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 04a3435..619d4cb 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -41,6 +41,6 @@ default = ["custom-protocol"] custom-protocol = ["tauri/custom-protocol"] [lints.rust] -# The `objc` crate's msg_send! macro expands to a `cfg(cargo-clippy)` check; -# declare it as a known cfg so it doesn't trip the unexpected_cfgs lint. -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(cargo-clippy)'] } +# The `objc` crate's msg_send! macro references a `cargo-clippy` cfg that trips +# the unexpected_cfgs lint — it's from the dependency macro, not our code. +unexpected_cfgs = "allow" diff --git a/src-tauri/src/audio.rs b/src-tauri/src/audio.rs index 29179ef..7c2d11e 100644 --- a/src-tauri/src/audio.rs +++ b/src-tauri/src/audio.rs @@ -76,13 +76,21 @@ impl AudioRecorder { output_path.display() ); + // The captured audio is AAC, but the container dictates the codec: + // WebM (VP9) can't hold AAC — it needs Opus; MP4 takes AAC. Using the + // wrong codec makes the mux fail, leaving a silent video-only file. + let audio_codec = match format { + "mp4" => "aac", + _ => "libopus", // webm + }; + let status = Command::new(ffmpeg_path()) .args([ "-y", "-i", &video_path.to_string_lossy(), "-i", &audio_path.to_string_lossy(), "-c:v", "copy", - "-c:a", "aac", + "-c:a", audio_codec, "-shortest", &output_path.to_string_lossy(), ]) diff --git a/src/services/capture/tauri.ts b/src/services/capture/tauri.ts index a7d99eb..c8b8c14 100644 --- a/src/services/capture/tauri.ts +++ b/src/services/capture/tauri.ts @@ -66,6 +66,10 @@ export class TauriCaptureService implements CaptureService { fps: options?.fps, displayId: options?.displayId, bounds: options?.bounds, + // Without these the Rust side never starts the audio recorder, + // so recordings came out silent. + includeAudio: options?.includeAudio, + systemAudio: options?.systemAudio, }, });