Repository navigation
medialink: hands-free listening ignores the microphone's opening click - #364
Merged
Merged
Conversation
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.
A hands-free
Intercomtook a turn of nothing back every time the peer finished talking. On a Waveshare ESP32-P4-WIFI6-Touch-LCD-4B talking hands-free to a computer that answered each turn, every answer was followed by a 1.1 s turn from the board with nothing in it; when the computer answered that turn too ("I didn't catch that"), the two sides kept trading empty turns until the run ended (seven in a row).The cause is the microphone, not the speaker. Each time it opens, its first 20 ms frame peaks far over the room (720 to 16,406 against a room of about 200), whether a turn has just played or the board sat quiet for two seconds. audiodsp's speech detector marks the next 160 ms as speech, and with
hold_msthat becomes a turn.Intercomnow throws away the firstsettle_ms(60 ms by default) each time hands-free listening opens the microphone, before the voice activity hears it. The guide's hands-free section says so.On the board. The same run with the change: three spoken sentences each took one turn and got their answer, and no turn followed an answer (4 turns in 70 s, against 10 before). The one extra turn came at the start, when the microphone first opened; that is a separate thing, below. 502 frames played with 0 underruns, 173 ms late (max 257).
Test.
test_the_microphones_opening_click_is_not_speechgives a warmed-up level detector a microphone whose first frame is a click. It fails on main (the click takes a turn) and passes with the change; withsettle_ms=0it takes the turn again.Not fixed here: on this board, the first time the microphone opens after boot, the speech detector hears about 3.4 s of speech in a quiet room. A second open a moment later hears none. A hands-free example whose peer is already there takes one empty turn as it starts.