refactor(ops): 重构 TTS 语音播报队列,解耦 ttsFlag 与队列优先级

移除 Thread.sleep(5000) 阻塞,改由 TTS 队列按设备维度控制播报顺序和间隔:
- 解耦 ttsFlag(硬件行为 0x09)与 priority(队列位置),全部使用 0x09 发送
- TtsQueueMessage 新增 inOrder/urgent 工厂方法,VoiceBroadcastService 精简为
  broadcastInOrder(FIFO rightPush)和 broadcastUrgent(leftPush 插队)两个入口
- 同设备播报间隔 3s → 6s,消息过期时间 30s → 60s
- 修复原 leftPush+leftPop LIFO 导致连续入队顺序反转的问题

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
lzh
2026-02-08 00:19:24 +08:00
parent db5266d306
commit 4f737a5dd1
7 changed files with 144 additions and 213 deletions

View File

@@ -149,7 +149,7 @@ ops:
tts:
queue:
enabled: true # 是否启用 TTS 语音播报队列
interval-ms: 3000 # 同一设备播报间隔(毫秒)
interval-ms: 6000 # 同一设备播报间隔(毫秒)
max-queue-size: 50 # 单个设备队列最大长度
debug: false