Fix/866 backlog audio cleanup#978
Conversation
Backlog 界面点击语音按钮时只调用 play(),未暂停其他 正在播放的 backlog 音频元素,导致多条语音同时播放。 同时未暂停游戏内正在播放的 currentVocal 语音, 点击 backlog 语音时与游戏内语音混合。 通过 querySelectorAll 匹配所有 backlog audio 元素, 在播放新语音前暂停并重置其他元素;同时暂停并重置 currentVocal 元素以避免与 backlog 语音混合。 Closes OpenWebGAL#866
Backlog 打开时自动播放不应推进剧情,否则在历史界面 点选 backlog 语音暂停 currentVocal 后,auto 会立即推进 到下一句对话并触发新的 vocal 播放,导致 Backlog 中听到 两条声音。 - autoPlay 在 Backlog 打开时直接 return,避免推进 - Backlog 点击 backlog 语音时同时 unmount vocal-play perform,清理外部 pause 留下的状态不一致 属于 OpenWebGAL#866 修复的延伸场景。
There was a problem hiding this comment.
Code Review
This pull request prevents auto-play from advancing the story when the Backlog UI is open, and improves audio handling by pausing other backlog and game vocal audio when a backlog voice is played. The review feedback suggests clearing the existing autoTimeout when the Backlog is open to ensure auto-play is fully paused, and simplifying the audio pausing logic in Backlog.tsx by pausing all backlog audio elements unconditionally since the current audio is reset and played immediately after.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
移除 'audio.id !== currentAudioId' 排除判断。后续逻辑会 重置并播放当前音频(currentTime = 0 + play()),故前置 pause 不需要排除当前。简化代码,无功能差异。 反馈来源:PR review
修复内容
修复 Backlog 界面点击语音按钮时多条音频混合播放的问题。
修改
Backlog.tsx:点击 backlog 语音按钮时,暂停其他正在播放的 backlog 音频和游戏内currentVocal语音autoPlay.ts:Backlog 打开时 auto 不推进剧情涉及 Issue
Closes #866
测试场景
Commit
0d6797c7fix(backlog): stop other backlog audio and game vocal on click940c2cfafix(autoplay): pause auto play while Backlog is open