fix: client_voice_stop doesn't change if listen_mode is manual

This commit is contained in:
Harold 2025-11-12 16:17:57 +08:00
parent 8b115eb169
commit 97739bea9e
2 changed files with 3 additions and 2 deletions

View file

@ -50,7 +50,7 @@ class ASRProvider(ASRProviderBase):
file=audio_file, file=audio_file,
response_format="text" response_format="text"
) )
logger.bind(tag=TAG).debug( logger.bind(tag=TAG).info(
f"Audio transcription latency: {time.time() - start_time:.3f}s | Result: {transcription}" f"Audio transcription latency: {time.time() - start_time:.3f}s | Result: {transcription}"
) )

View file

@ -78,6 +78,7 @@ class VADProvider(VADProviderBase):
if conn.client_have_voice and not client_have_voice: if conn.client_have_voice and not client_have_voice:
stop_duration = time.time() * 1000 - conn.last_activity_time stop_duration = time.time() * 1000 - conn.last_activity_time
if stop_duration >= self.silence_threshold_ms: if stop_duration >= self.silence_threshold_ms:
if conn.client_listen_mode != "manual":
conn.client_voice_stop = True conn.client_voice_stop = True
if client_have_voice: if client_have_voice:
conn.client_have_voice = True conn.client_have_voice = True