Two-way voice: barge-in gated at 150 dB floor + spoken-reply handback - #3
Merged
Merged
Conversation
While a response plays in background, the mic is monitored (sox/arecord/ ffmpeg). A sustained signal above SPEECH_BARGE_IN_DB (default 150, SPL-equivalent - extreme by design so background noise can never interrupt) kills playback and records the user's reply. ElevenLabs speech-to-text (scribe_v1) transcribes it and the hook hands the words back to SirGent via Stop-hook decision:block, so the conversation continues by voice. New /voice command toggles the mode (flag-file based, wins over env). Offline unit tests cover dB mapping, floor gating, and handback JSON. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <[email protected]>
Owner
|
DoNE |
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
Extends the speech plugin (PR #2, merged) with two-way voice conversation:
sox,arecord, orffmpeg).SPEECH_BARGE_IN_DB(default 150) is deliberately extreme: ordinary background noise (music, fans, typing, normal conversation ≈ 100–140 dB-eq) can never interrupt; only a sustained near-full-scale signal (~180 dB-eq, a close-range shout held ~2 s) does. Tunable via env var.SPEECH_REPLY_SECS(12 s) of the user's reply, transcribes it with ElevenLabsscribe_v1STT, and feeds the words back to SirGent via the Stop-hookdecision: blockcontract, so the conversation continues by voice./voicecommand — toggles the mode via~/.sirgent/speech-conversationflag file (wins overSPEECH_CONVERSATION=1).Safety
test_two_way.py): dB mapping sanity (quiet room ~100 dB-eq < 150 < shout ~180), floor gating on synthetic WAVs, handback JSON shape — all PASS🤖 Generated with Codebuff