fix: 修复新旧 TTS 语音重叠播放的问题

- TTSPlayer 新增 stopCurrentAudio() 方法,play() 开始前先停止旧音频
- onSpeechEnd 发送新 query 前停止上一轮 TTS 播放
This commit is contained in:
2026-06-14 12:01:34 +08:00
parent eb7ebecfc0
commit 24a6ce5295
2 changed files with 20 additions and 0 deletions

View File

@@ -158,6 +158,10 @@ export function useVisionSession() {
return;
}
// 停止上一轮的 TTS 播放,防止新旧音频重叠
ttsPlayerRef.current?.stop();
setIsAudioPlaying(false);
const frame = captureFrame();
if (!frame) {
console.warn("[Session] 无法捕获图像帧");