diff --git a/main/xiaozhi-server/core/handle/sendAudioHandle.py b/main/xiaozhi-server/core/handle/sendAudioHandle.py index fc2c6f6c..63a2411c 100644 --- a/main/xiaozhi-server/core/handle/sendAudioHandle.py +++ b/main/xiaozhi-server/core/handle/sendAudioHandle.py @@ -263,7 +263,7 @@ async def _do_send_audio(conn: "ConnectionHandler", opus_packet, flow_control): async def send_tts_message(conn: "ConnectionHandler", state, text=None): """发送 TTS 状态消息""" if text is None and state == "sentence_start": - return + return message = {"type": "tts", "state": state, "session_id": conn.session_id} if text is not None: message["text"] = textUtils.check_emoji(text) @@ -315,4 +315,4 @@ async def send_stt_message(conn: "ConnectionHandler", text): ) await send_tts_message(conn, "start") # 发送start消息后客户端状态会处于说话中状态,同步服务端状态 - conn.client_is_speaking = True \ No newline at end of file + conn.client_is_speaking = True