Repository navigation
feat(asr): stop crediting the user with the other side's words on speakers - #536
Merged
Merged
Conversation
…inal pass Without headphones the mic hears the remote side, so every remote sentence also became a line credited to the user. The fold already hides a line marked echo, but nothing wrote the mark. One narrow rule now marks it on both paths: at least 3 words, the call line first, the mic line within 1.5 s of its end, and at least 70 % of its words in the call line. The line stays in the log.
… echo case that needs it
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 46 minutes. View limit details
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. |
The final pass cuts the call channel at every diarized turn and the mic channel only at pauses, so a mic line holding the echo of two remote turns matched neither call line alone and came back in the view after the final pass. Both paths now pool the call lines the mic line may have heard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On a call without headphones, the mic hears the laptop speakers. Each sentence from the other side then shows up twice: once as a call line and once as a line from the user. Both stayed in the window, packs, shares, exports and agent answers, so the user was credited with words they never said. The log schema and the fold already hide a line marked
echo, but nothing ever wrote that mark. The echo banner, which counts marked lines, could never fire.Fix
One rule in
src/core/log/echo.tsdecides when a mic line is the mic hearing a call line. The rule is narrow so that a person reading back a number or a name keeps their line:The live path checks every new line against the other channel's lines from the last 10 s. It checks when either channel writes, because a call line can close after the mic line that heard it. A match writes a new revision with only
echo: true. It never writesecho: false, and it skips a line a person has edited. The final pass applies the same rule and setsechoon the mic line's first revision. The marked line stays in the log. Only the views leave it out.The new trap is
[ECHO-1]in docs/TRAPS.md. DESIGN 3.1 step 7 now states the extra guards. The coverage line in docs/TESTING.md now points at tests that exist.Testing
tests/echo.test.tstests each limit of the rule with a case just inside it and a case just outside it: 1.5 s against 1.6 s, 7 of 10 words against 6 of 10, 3 words against 2, and a call line that starts first against one that starts 1 ms later.tests/asr-live.test.tsplays the same speech on both channels through the in-thread live pipeline. It runs once with the mic line written first and once with the call line written first. In both runs the mic line gets the echo revision, stays in the log and leaves theliveview. As a positive control, different speech at the same time gets no mark.tests/asr-final.test.tsruns the same check through the final pass, with the same control.bun run check:staticpasses. The three test files pass: 90 tests, 0 failures.