Skip to content

fix(recording): avoid doubled mic audio (echo) on macOS system+mic captures#695

Open
josh-abram wants to merge 1 commit into
webadderallorg:mainfrom
josh-abram:fix/issue-628-mac-mic-echo
Open

fix(recording): avoid doubled mic audio (echo) on macOS system+mic captures#695
josh-abram wants to merge 1 commit into
webadderallorg:mainfrom
josh-abram:fix/issue-628-mac-mic-echo

Conversation

@josh-abram

@josh-abram josh-abram commented Jun 22, 2026

Copy link
Copy Markdown

Description

Recording on macOS with both system audio and the microphone enabled played the mic twice, producing an echo that drifted out of sync over the take. This is a two-line fix.

Motivation

On macOS the system-audio capture already includes the microphone, so the recording on disk is already a complete system + mic mix. The companion-audio fallback still added the separate mic sidecar on top, so every system+mic recording played the microphone twice. The two copies come from independently clocked capture paths, so they drift apart as the recording continues — that growing drift is the echo users hear. Disabling system audio "fixed" it only by removing the duplicate source. Reported in #628.

The fix

When a usable macOS system-audio companion exists, use the embedded recording alone instead of also layering the mic sidecar. The embedded mix already contains both system audio and the mic, so the duplicate and its drift are gone. The branch is macOS-scoped, so Windows and mic-only recordings are unchanged. Net change: two lines, one file.

Type of Change

  • Bug Fix

Related Issue(s)

Fixes #628

Screenshots / Video

No UI change — this is an audio-routing fix. Happy to add a short before/after clip if useful.

Testing Guide

On macOS, record with system audio and the built-in mic both on, talking while some system audio plays. Before: the mic is doubled and drifts further out of sync the longer you record. After: a single clean mic, in sync for the whole take.

Tested this end to end on an M4 Mac, built the DMG from this branch, installed it, and recorded on a machine that was reproducing the bug. The echo was present before the change and gone immediately after. Existing companion-audio tests pass.

Checklist

  • Self-review performed.
  • Related issue linked.
  • Screenshots/video — not applicable (audio-only fix).

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced macOS recording audio fallback logic to correctly select companion audio paths when system audio is available.

On macOS the system-audio capture already contains the mic, so the recording embeds a full system+mic mix. The fallback also added the separate mic sidecar, doubling the mic into an echo. Use the embedded mix alone. Fixes webadderallorg#628.
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

In getCompanionAudioFallbackInfo, an else if branch is added to the macOS embedded-audio fallback logic. When hasUsableMacSystemCompanion is true, paths is now explicitly set to [videoPath], preventing fall-through to subsequent companion-path derivation logic.

Changes

macOS system companion audio fallback path fix

Layer / File(s) Summary
macOS system companion else-if branch
electron/ipc/recording/diagnostics.ts
Adds an else if (hasUsableMacSystemCompanion) branch that sets paths = [videoPath], short-circuiting the fallback before it can reach other companion-path selection logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • webadderallorg/Recordly#553: Also modifies getCompanionAudioFallbackInfo's paths selection in the same file, limiting embedded-audio fallback paths to only candidate.micPath.
  • webadderallorg/Recordly#645: Modifies the same macOS fallback path-selection logic in getCompanionAudioFallbackInfo, focusing on usable mac "system" vs "mic-only" companion path preferences.
  • webadderallorg/Recordly#280: Changes how getCompanionAudioFallbackPaths builds and filters returned video and mic companion paths when embedded audio is present in the same file.

Suggested labels

Checked

🐇 A branch so small, yet sharp as a thorn,
One else if to stop the paths being torn.
No echoes shall ring through the macOS air,
Just one tidy videoPath, simple and fair!
The rabbit hops on — the audio's repaired! 🎙️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main fix: preventing doubled microphone audio (echo) on macOS system+mic captures.
Linked Issues check ✅ Passed The PR directly addresses issue #628 by fixing the doubled microphone audio on macOS system+mic recordings, ensuring only one audio track is captured without echo.
Out of Scope Changes check ✅ Passed All changes are scoped to the audio routing logic for macOS system+mic scenarios, with no unrelated modifications to other recording paths or features.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description comprehensively covers all required template sections with clear context, motivation, fix details, testing approach, and appropriate checklist items.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@josh-abram

Copy link
Copy Markdown
Author

@webadderall For review mate. Cool to see this is made by a fellow Aussie too.

@josh-abram

Copy link
Copy Markdown
Author

Should also fix #662

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Double input audio

1 participant