Skip to content

fix(audio): route companion files to source tracks - #1127

Open
SomSamantray wants to merge 2 commits into
webadderallorg:mainfrom
SomSamantray:fix/audio-source-track-id-parser-1124
Open

SomSamantray wants to merge 2 commits into
webadderallorg:mainfrom
SomSamantray:fix/audio-source-track-id-parser-1124

Conversation

@SomSamantray

@SomSamantray SomSamantray commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Description

Audio files whose names identify a mic or system source now route to the matching track instead of being classified as mixed. The routing engine uses the shared path classifier, so names such as recording-mic.wav and system.mp4 retain their source identity.

Motivation

The audio processor already recognizes these filename conventions, but the routing engine only recognized .mic. and .system. markers. Companion files with other supported names therefore lost their source ID and could be mixed into the wrong track.

Type of Change

  • New Feature
  • Bug Fix
  • Refactor / Code Cleanup
  • Documentation Update
  • Other (please specify)

Related Issue(s)

Fixes #1124

Screenshots / Video

Not applicable; this fixes audio routing and adds no visual UI.

Testing Guide

  • npm test -- src/lib/exporter/audioRoutingEngine.test.ts src/lib/exporter/audioEncoder.test.ts src/lib/exporter/useAudioPreviewSync.test.ts — 21 tests passed.
  • npm test — 1,468 tests passed, 6 skipped.
  • npm run typecheck — passed.
  • npm run lint — passed with one existing warning in ProjectThumbnail.tsx.
  • Browser smoke check: the root page rendered. The editor route stayed on “Loading editor…” in a standalone browser because it requires the Electron preload bridge.

Checklist

  • I have performed a self-review of my code.
  • I have added any necessary screenshots or videos.
  • I have linked related issue(s) and updated the changelog if applicable.

AI disclosure: OpenAI Codex assisted with analysis, implementation, and verification.


Thank you for contributing!

Summary by CodeRabbit

  • Refactor
    • Consolidated how recording audio sources are identified, with no change to the available audio track options.
  • Tests
    • Added coverage for microphone and system audio track routing, recording companion paths, and playback order.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: webadderallorg/Recordly/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 434b670f-9d3b-4381-9948-960b2e3c8671

📥 Commits

Reviewing files that changed from the base of the PR and between 535d1cf and 0e0adae.


📒 Files selected for processing (3)
  • src/lib/exporter/audioProcessorShared.ts
  • src/lib/exporter/audioRoutingEngine.test.ts
  • src/lib/exporter/audioRoutingEngine.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.



📝 Walkthrough

Walkthrough

The source-track type and path-classification helper are centralized in audioProcessorShared. audioRoutingEngine re-exports them, and new tests cover companion-path classification and routing-plan output.

Changes

Audio track classification

Layer / File(s) Summary
Centralize and verify track classification
src/lib/exporter/audioProcessorShared.ts, src/lib/exporter/audioRoutingEngine.ts, src/lib/exporter/audioRoutingEngine.test.ts
audioProcessorShared exports SourceTrackId and the canonical path-classification helper. audioRoutingEngine re-exports them instead of defining a local type and helper. Tests cover four path classifications, exclude the video path, map microphone and system companions to dedicated tracks, and verify system-then-microphone playback order.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium


Merge Risk: ⚪ Minimal · up to 0e0ad

Companion audio files now route to the matching mic or system track through the shared classifier. No remaining merge-blocking risk was found.

Pre-merge checks | Passed 4 | Failed 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. 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 clearly and concisely describes the primary change: routing companion audio files to their source tracks.
Description check Passed The description covers the purpose, motivation, bug-fix classification, related issue, testing steps, browser limitation, and checklist status. The screenshots section is correctly marked as not appli…
Linked Issues check Passed Issue #1124 requires one canonical getSourceTrackIdFromPath implementation and correct classification of supported companion paths. audioRoutingEngine.ts removes the duplicate parser and re-export…
Out of Scope Changes check Passed The pull request changes only the shared source-track type, the routing-engine parser export, and focused routing tests. These changes directly implement issue #1124 and provide regression coverage. N…

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

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.

fix(audio): deduplicate getSourceTrackIdFromPath and fix companion track misclassification

1 participant