mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-26 09:03:54 +08:00
Merge branch 'py_test_tts' of https://github.com/xinnan-tech/xiaozhi-esp32-server into py_test_tts
This commit is contained in:
@@ -109,6 +109,9 @@ async def send_stt_message(conn, text):
|
||||
if isinstance(parsed_data, dict) and "content" in parsed_data:
|
||||
# 如果是包含说话人信息的JSON格式,只显示content部分
|
||||
display_text = parsed_data["content"]
|
||||
# 保存说话人信息到conn对象
|
||||
if "speaker" in parsed_data:
|
||||
conn.current_speaker = parsed_data["speaker"]
|
||||
except (json.JSONDecodeError, TypeError):
|
||||
# 如果不是JSON格式,直接使用原始文本
|
||||
display_text = text
|
||||
|
||||
Reference in New Issue
Block a user