mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
fix: client_voice_stop doesn't change if listen_mode is manual
This commit is contained in:
parent
8b115eb169
commit
97739bea9e
2 changed files with 3 additions and 2 deletions
|
|
@ -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}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,8 @@ 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:
|
||||||
conn.client_voice_stop = True
|
if conn.client_listen_mode != "manual":
|
||||||
|
conn.client_voice_stop = True
|
||||||
if client_have_voice:
|
if client_have_voice:
|
||||||
conn.client_have_voice = True
|
conn.client_have_voice = True
|
||||||
conn.last_activity_time = time.time() * 1000
|
conn.last_activity_time = time.time() * 1000
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue