From 4952ccfbf7216ef12c8262ab4e65f2aea418fe55 Mon Sep 17 00:00:00 2001 From: Sakura-RanChen <1908198662@qq.com> Date: Mon, 13 Oct 2025 16:47:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=9B=B8=E5=85=B3=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=9C=AA=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/xiaozhi-server/core/handle/helloHandle.py | 3 ++- main/xiaozhi-server/core/handle/receiveAudioHandle.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main/xiaozhi-server/core/handle/helloHandle.py b/main/xiaozhi-server/core/handle/helloHandle.py index 0c13ea1d..e5df55c7 100644 --- a/main/xiaozhi-server/core/handle/helloHandle.py +++ b/main/xiaozhi-server/core/handle/helloHandle.py @@ -6,7 +6,7 @@ from core.utils.dialogue import Message from core.utils.util import audio_to_data from core.providers.tts.dto.dto import SentenceType from core.utils.wakeup_word import WakeupWordsConfig -from core.handle.sendAudioHandle import sendAudioMessage, send_stt_message +from core.handle.sendAudioHandle import sendAudioMessage, send_tts_message from core.utils.util import remove_punctuation_and_length, opus_datas_to_wav_bytes from core.providers.tools.device_mcp import ( MCPClient, @@ -83,6 +83,7 @@ async def checkWakeupWords(conn, text): return False conn.just_woken_up = True + await send_tts_message(conn, "start") # 获取当前音色 voice = getattr(conn.tts, "voice", "default") diff --git a/main/xiaozhi-server/core/handle/receiveAudioHandle.py b/main/xiaozhi-server/core/handle/receiveAudioHandle.py index f916bb7d..e7b6a138 100644 --- a/main/xiaozhi-server/core/handle/receiveAudioHandle.py +++ b/main/xiaozhi-server/core/handle/receiveAudioHandle.py @@ -14,7 +14,7 @@ async def handleAudioMessage(conn, audio): # 当前片段是否有人说话 have_voice = conn.vad.is_vad(conn, audio) # 如果设备刚刚被唤醒,短暂忽略VAD检测 - if have_voice and hasattr(conn, "just_woken_up") and conn.just_woken_up: + if hasattr(conn, "just_woken_up") and conn.just_woken_up: have_voice = False # 设置一个短暂延迟后恢复VAD检测 conn.asr_audio.clear()