mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-27 17:43:55 +08:00
update:通过“当会话ID为None时,自动生成新的会话ID”,解决“首次从智控台连接后,无法播放音乐”的问题
This commit is contained in:
@@ -202,6 +202,10 @@ class TTSProvider(TTSProviderBase):
|
|||||||
if message.sentence_type == SentenceType.FIRST:
|
if message.sentence_type == SentenceType.FIRST:
|
||||||
# 初始化参数
|
# 初始化参数
|
||||||
try:
|
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会话...")
|
logger.bind(tag=TAG).info("开始启动TTS会话...")
|
||||||
future = asyncio.run_coroutine_threadsafe(
|
future = asyncio.run_coroutine_threadsafe(
|
||||||
self.start_session(self.conn.sentence_id),
|
self.start_session(self.conn.sentence_id),
|
||||||
|
|||||||
Reference in New Issue
Block a user