Skip to content

fix(label): handle sensitive condenser mics in YOU detection#17

Merged
pretyflaco merged 1 commit intomainfrom
fix/mic-margin-condenser
May 5, 2026
Merged

fix(label): handle sensitive condenser mics in YOU detection#17
pretyflaco merged 1 commit intomainfrom
fix/mic-margin-condenser

Conversation

@pretyflaco
Copy link
Copy Markdown
Owner

Summary

The dual-channel YOU/REMOTE labeling in _label_speakers_from_channels declares a speaker as YOU only if their mic-channel-energy ratio exceeds 0.5. Sensitive condenser mics (e.g. RODE NT-USB) pick up enough room audio that the local speaker's ratio sits below 0.5 even though they are clearly the most mic-dominant — so YOU never gets assigned and the local speaker becomes a REMOTE_X.

Changes

  • Add a relative-margin check alongside the absolute one. If the top candidate's mic ratio is more than 0.1 above the average of all other speakers' ratios (and absolute ratio > 0.15 to avoid silent edge cases), assign YOU.
  • Log the margin and average for debugging:
    Best candidate: SPEAKER_00 (ratio=0.412, margin=0.367 over avg=0.045)
    

Tests

  • New test_sensitive_condenser_mic_assigns_you_via_margin: synthesizes a 3-segment stereo WAV where the local speaker has ratio ~0.4 (below 0.5) but the average of other speakers' ratios is ~0.05. Asserts YOU is assigned via the margin path.
  • All 5 existing TestLabelSpeakersFromChannels tests still pass.

The dual-channel YOU/REMOTE labeling in _label_speakers_from_channels
declares a speaker as YOU only if their mic-channel-energy ratio
exceeds 0.5.  Sensitive condenser mics (e.g. RODE NT-USB) pick up
enough room audio that the local speaker's ratio sits below 0.5 even
though they are clearly the most mic-dominant — so YOU never gets
assigned and the local speaker becomes a REMOTE_X.

Add a relative-margin check alongside the absolute one: if the top
candidate's ratio is more than 0.1 above the average of all other
speakers' ratios (and absolute ratio > 0.15 to avoid silent edge
cases), assign YOU.  Log the margin and average for debugging.

Test: synthesize a 3-segment stereo WAV where the local speaker has
ratio ~0.4 (below 0.5) but average of other speakers is ~0.05;
assert YOU is assigned via the margin path.

All 5 TestLabelSpeakersFromChannels tests pass.
@pretyflaco pretyflaco merged commit 0132291 into main May 5, 2026
1 check 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