Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11327,21 +11327,25 @@ def _voice_stop_and_transcribe(self):
pass

# Track consecutive no-speech cycles to avoid infinite restart loops.
_stop_continuous = False
if not submitted:
self._no_speech_count = getattr(self, '_no_speech_count', 0) + 1
if self._no_speech_count >= 3:
self._voice_continuous = False
self._no_speech_count = 0
_cprint(f"{_DIM}No speech detected 3 times, continuous mode stopped.{_RST}")
return
_stop_continuous = True
else:
self._no_speech_count = 0

# If no transcript was submitted but continuous mode is active,
# restart recording so the user can keep talking.
# (When transcript IS submitted, process_loop handles restart
# after chat() completes.)
if self._voice_continuous and not submitted and not self._voice_recording:
if (not _stop_continuous
and self._voice_continuous
and not submitted
and not self._voice_recording):
def _restart_recording():
try:
self._voice_start_recording()
Expand Down
Loading