Skip to content

fix(recording): avoid duplicate system audio fallback#553

Merged
meiiie merged 1 commit into
mainfrom
fix/embedded-audio-companion-fallback
May 22, 2026
Merged

fix(recording): avoid duplicate system audio fallback#553
meiiie merged 1 commit into
mainfrom
fix/embedded-audio-companion-fallback

Conversation

@meiiie
Copy link
Copy Markdown
Collaborator

@meiiie meiiie commented May 22, 2026

Summary

  • When a recording MP4 already has an embedded audio stream, only include microphone companion audio in the fallback path list.
  • Avoid adding recording.system.wav next to the embedded video audio, which duplicates source/system audio candidates.

Why

getCompanionAudioFallbackInfo() was still returning both recording.system.wav and recording.mic.wav when the video itself already contained an audio stream. That contradicted the existing test expectation and can make downstream audio fallback/mux planning consider duplicate system audio.

This is a small extraction from the broader #504 work, separated so we do not merge the stale NVIDIA/export route planner PR as one large change.

Validation

  • npm test -- electron/ipc/recording/diagnostics.test.ts (11 passed)
  • npx tsc --noEmit
  • npx biome check --formatter-enabled=false electron/ipc/recording/diagnostics.ts electron/ipc/recording/diagnostics.test.ts
  • git diff --check

Note: npx biome check with formatter enabled wants to rewrite existing CRLF line endings across these files, so I used formatter-disabled scoped Biome to avoid unrelated formatting churn.

Summary by CodeRabbit

  • Bug Fixes
    • Improved companion audio fallback path selection when embedded audio streams are detected, ensuring the correct fallback option is used during recording.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3bee3c98-f9b5-44f7-8b02-51240a08cb35

📥 Commits

Reviewing files that changed from the base of the PR and between 7fe818f and 059544d.

📒 Files selected for processing (1)
  • electron/ipc/recording/diagnostics.ts

📝 Walkthrough

Walkthrough

The change constrains the fallback companion audio path selection in getCompanionAudioFallbackInfo to use only the microphone path when an embedded audio stream is detected, removing system audio from that fallback candidate set.

Changes

Embedded Audio Companion Path Filtering

Layer / File(s) Summary
Embedded audio usable paths constraint
electron/ipc/recording/diagnostics.ts
When an embedded audio stream is detected, the usablePaths filter for companion audio fallback is tightened to include only candidate.micPath, excluding candidate.systemPath. This constraint affects the resulting paths array and the computed startDelayMsByPath for that embedded-audio case.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • webadderallorg/Recordly#280: Both PRs adjust embedded-audio fallback path selection in electron/ipc/recording/diagnostics.ts to filter down to candidate.micPath, with #280 adding test coverage for that case.

Suggested labels

Checked

Poem

🐰 One path to pick, the microphone's call,
When audio streams are embedded in all,
System sound step back, the mic takes the lead,
A focused companion is all that we need!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(recording): avoid duplicate system audio fallback' accurately summarizes the main change—preventing duplicate system audio in companion fallback paths when embedded audio is detected.
Description check ✅ Passed The PR description covers the key required sections including summary, motivation, type of change (bug fix context), validation steps, and addresses the underlying issue clearly.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/embedded-audio-companion-fallback

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

@meiiie meiiie merged commit 9f896ec into main May 22, 2026
3 checks passed
@meiiie meiiie deleted the fix/embedded-audio-companion-fallback branch May 22, 2026 11:18
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