From 9685a37cf19a02c71bcab24865ea288770e0e84b Mon Sep 17 00:00:00 2001 From: birdstudy-nj Date: Tue, 26 May 2026 15:27:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BE=AA=E7=8E=AF?= =?UTF-8?q?=E6=92=AD=E6=94=BEtts=E8=AF=AD=E9=9F=B3=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=B9=8B=E4=B8=80=20(#888)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaomusic/device_player.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xiaomusic/device_player.py b/xiaomusic/device_player.py index 927212e..43bd193 100644 --- a/xiaomusic/device_player.py +++ b/xiaomusic/device_player.py @@ -950,7 +950,8 @@ class XiaoMusicDevice: if duration > 0: async def _tts_timeout(): - await asyncio.sleep(duration) + # 增加2秒,确保小爱音箱缓存完毕后,触发后续stop + await asyncio.sleep(duration + 2) try: self.log.info("TTS 播放定时器时间到") current_timer = self._tts_timer @@ -1324,4 +1325,4 @@ class XiaoMusicDevice: selected_name = self._pending_selection[index - 1] self.log.info(f"用户选择了第{index}个: {selected_name}") # 保持待选择状态不变,支持用户继续选择其他歌曲 - await self._playmusic(selected_name) + await self._playmusic(selected_name) \ No newline at end of file