fix: 提示尾音播放和单模块第一次唤醒时等待tts初始化

This commit is contained in:
Sakura-RanChen
2025-09-02 12:00:04 +08:00
parent c428a9ddee
commit c3c2e7c28e
2 changed files with 20 additions and 14 deletions
+10 -1
View File
@@ -56,7 +56,16 @@ async def checkWakeupWords(conn, text):
"enable_wakeup_words_response_cache"
]
if not enable_wakeup_words_response_cache or not conn.tts:
# 等待tts初始化,最多等待3秒
start_time = time.time()
while time.time() - start_time < 3:
if conn.tts:
break
await asyncio.sleep(0.1)
else:
return False
if not enable_wakeup_words_response_cache:
return False
_, filtered_text = remove_punctuation_and_length(text)