mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-29 11:53:55 +08:00
update:优化带有方括号的字符语音转换
This commit is contained in:
@@ -2,6 +2,7 @@ import time
|
||||
import json
|
||||
import random
|
||||
import asyncio
|
||||
from core.utils.dialogue import Message
|
||||
from core.utils.util import audio_to_data
|
||||
from core.handle.sendAudioHandle import sendAudioMessage, send_stt_message
|
||||
from core.utils.util import remove_punctuation_and_length, opus_datas_to_wav_bytes
|
||||
@@ -79,6 +80,9 @@ async def checkWakeupWords(conn, text):
|
||||
await sendAudioMessage(conn, SentenceType.FIRST, opus_packets, response["text"])
|
||||
await sendAudioMessage(conn, SentenceType.LAST, [], None)
|
||||
|
||||
# 补充对话
|
||||
conn.dialogue.put(Message(role="assistant", content=response["text"]))
|
||||
|
||||
# 检查是否需要更新唤醒词回复
|
||||
if time.time() - response["time"] > WAKEUP_CONFIG["refresh_time"]:
|
||||
if not _wakeup_response_lock.locked():
|
||||
|
||||
Reference in New Issue
Block a user