mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-25 00:23:53 +08:00
fix: 修复当手动设备上个会话正常结束后,使用唤醒词唤醒音频播放不完整
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import time
|
||||
import json
|
||||
import uuid
|
||||
import random
|
||||
import asyncio
|
||||
from core.utils.dialogue import Message
|
||||
@@ -105,6 +106,9 @@ async def checkWakeupWords(conn, text):
|
||||
# 播放唤醒词回复
|
||||
conn.client_abort = False
|
||||
|
||||
# 将唤醒词回复视为新会话,生成新的 sentence_id,确保流控器重置
|
||||
conn.sentence_id = str(uuid.uuid4().hex)
|
||||
|
||||
conn.logger.bind(tag=TAG).info(f"播放唤醒词回复: {response.get('text')}")
|
||||
await sendAudioMessage(conn, SentenceType.FIRST, opus_packets, response.get("text"))
|
||||
await sendAudioMessage(conn, SentenceType.LAST, [], None)
|
||||
|
||||
Reference in New Issue
Block a user