arrow_backRetour aux issues
mbailey/voicemode
#211
Débutant
Ouvrirarrow_forward
Débutant
Ouvrirarrow_forward
Débutant
Ouvrirarrow_forward
Feature Request: Barge-in / Interrupt TTS playback when user starts speaking
ecoDébutant
enhancement
help wanted
descriptionDescription
## Problem Statement
Currently, when Claude responds via TTS, users must wait for the entire response to finish before they can speak. This creates friction in natural conversation, especially when:
- The user has already understood the point and wants to respond
- The user needs to redirect the conversation
- The response is longer than necessary for the user's needs
## Proposed Solution
Add a "barge-in" or interrupt capability that detects when the user starts speaking and:
1. Immediately stops TTS playback
2. Seamlessly transitions to recording the user's voice input
3. Continues the conversation without requiring manual intervention
## Technical Approach
Looking at the existing `NonBlockingAudioPlayer` class in `audio_player.py`, a potential implementation could:
1. **Add a parallel VAD (Voice Activity Detection) thread** that continuously monitors the microphone during TTS playback
2. **When voice activity is detected**, stop the current TTS playback by:
- Clearing the audio queue
- Calling `stream.stop()`
- Setting the `playback_complete` event
3. **Capture the user's speech** and send it to Whisper for transcription
4. **Submit the transcription** to Claude as the next input
The existing code already uses threading and has mechanisms for stopping playback (`CallbackStop`, `playback_complete` event), so the infrastructure is partially there.
## Use Case
I use VoiceMode for hands-free coding assistance while working at my desk. The current turn-taking model works well for structured interactions, but true conversational flow requires the ability to interrupt when needed—similar to how human conversations naturally work.
This is especially valuable when:
- Claude is explaining something I already understand
- I realize I need to clarify my question mid-response
- I want to say "yes, do that" before Claude finishes listing all options
## Configuration Suggestion
This could be an opt-in feature via environment variable:
```
VOICEMODE_BARGE_IN=true
```
Some users might prefer the current sequential behavior for its predictability, so making it configurable would accommodate both preferences.
## Additional Context
- This feature is common in commercial voice assistants (Alexa, Google Assistant, Siri all support barge-in)
- The VAD functionality is already available through libraries like `webrtcvad` or could leverage the existing silence detection logic
- Low latency detection would be important to feel responsive (ideally <100ms from voice onset to TTS stop)
Thank you for building such a useful tool! VoiceMode has made hands-free coding with Claude practical and enjoyable.
Issues similaires
calkit/calkit
star53
Poids du dépôt moyen
VS Code extension should be robust to YAML parser errors
Seeing this error: ``` Failed to read calkit.yaml: YAMLParseError: A block sequence may not be used as an implicit map…
Python
bug
good first issue
fu351/Doberman-Core
star211
Poids du dépôt léger
dash: a manual Refresh control
The dashboard polls: `refreshStats()` (`src/doberman/dash/app.py:408`) every 5 s and `refreshPending()` (`:546`) every …
Python
enhancement
good first issue
fu351/Doberman-Core
star211
Poids du dépôt léger
dash: "Copy details" button on each pending-approval card
Each pending-approval card in the dashboard (`renderPending`, `src/doberman/dash/app.py:448-544`) shows the risk badge,…
Python
enhancement
good first issue