update:通过“当会话ID为None时,自动生成新的会话ID”,解决“首次从智控台连接后,无法播放音乐”的问题

This commit is contained in:
CGD
2025-06-13 10:34:36 +08:00
parent 25ccf7fed3
commit 2a8ec27ba6
@@ -202,6 +202,10 @@ class TTSProvider(TTSProviderBase):
if message.sentence_type == SentenceType.FIRST:
# 初始化参数
try:
if not getattr(self.conn, "sentence_id", None):
self.conn.sentence_id = uuid.uuid4().hex
logger.bind(tag=TAG).info(f"自动生成新的 会话ID: {self.conn.sentence_id}")
logger.bind(tag=TAG).info("开始启动TTS会话...")
future = asyncio.run_coroutine_threadsafe(
self.start_session(self.conn.sentence_id),