mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-28 01:53:53 +08:00
update:优化线程
This commit is contained in:
@@ -15,6 +15,7 @@ from plugins_func.loadplugins import auto_import_modules
|
||||
from config.logger import setup_logging
|
||||
from core.utils.dialogue import Message, Dialogue
|
||||
from core.providers.tts.dto.dto import ContentType, TTSMessageDTO, SentenceType
|
||||
from core.providers.tts.default import DefaultTTS
|
||||
from core.handle.textHandle import handleTextMessage
|
||||
from core.utils.util import (
|
||||
extract_json_from_string,
|
||||
@@ -312,7 +313,7 @@ class ConnectionHandler:
|
||||
if self.asr is None:
|
||||
self.asr = self._asr
|
||||
if self.tts is None:
|
||||
self.tts = self._tts
|
||||
self.tts = DefaultTTS(self.config, delete_audio_file=True)
|
||||
# 使用事件循环运行异步方法
|
||||
asyncio.run_coroutine_threadsafe(self.tts.open_audio_channels(self), self.loop)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user