Repository navigation
fix(voice): ignore the voice key while processing and trim silence from dictated pieces - #821
Merged
Merged
Conversation
…om dictated pieces Pressing the voice key during Processing started a new session, which cancelled the pending recognition and dropped its text. Ignore it in that state; the cancel button on the strip still does it on purpose. In transcribe while speaking, the last piece included the whole silence timeout and a single noisy frame counted as speech, so Whisper invented trailing words. Cut the silence after the last speech (keeping 0.5 s of padding, at least 1 s) and drop pieces with under 300 ms of speech.
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.
Summary of Changes
Two voice dictation fixes found while testing "Transcribe while speaking" on a device.
Motivation & Context
startVoice()cancels the previous session first, so any text still being recognized was dropped.Changes Made
VoiceInputManager.voiceKeyActionFordecides what the voice key does: stop while recording, ignore while the final text is being recognized, start otherwise.LatinIMEuses it. The cancel button on the strip still cancels on purpose.VoicePiecewiseTestcovers the trim and the key rule.Verification & Testing
helium314.keyboard.latin.voice.*unit tests passGuidelines Checklist