fix: 文本重复发送

This commit is contained in:
Sakura-RanChen
2025-07-23 14:35:59 +08:00
parent 60cbe1571c
commit e93053d412
6 changed files with 46 additions and 39 deletions
@@ -12,7 +12,7 @@ async def sendAudioMessage(conn, sentenceType, audios, text):
conn.logger.bind(tag=TAG).info(f"发送音频消息: {sentenceType}, {text}")
pre_buffer = False
if conn.tts.tts_audio_first_sentence and text is not None:
if conn.tts.tts_audio_first_sentence:
conn.logger.bind(tag=TAG).info(f"发送第一段语音: {text}")
conn.tts.tts_audio_first_sentence = False
pre_buffer = True
@@ -73,7 +73,7 @@ async def send_tts_message(conn, state, text=None):
"""发送 TTS 状态消息"""
message = {"type": "tts", "state": state, "session_id": conn.session_id}
if text is not None:
message["text"] = text
message["text"] = textUtils.check_emoji(text)
# TTS播放结束
if state == "stop":