From 00a989277e4c83c87cbc024997c25c660db9c41e Mon Sep 17 00:00:00 2001 From: ULTRACOMBOS-DEV Date: Fri, 26 Sep 2025 11:37:50 +0800 Subject: [PATCH] update --- vite/src/pages/flow_free.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/vite/src/pages/flow_free.jsx b/vite/src/pages/flow_free.jsx index ea5e135..9a729d3 100644 --- a/vite/src/pages/flow_free.jsx +++ b/vite/src/pages/flow_free.jsx @@ -292,6 +292,8 @@ export function FreeFlow(){ } function fadeOutAudio(callback){ + if(refVolDownInterval.current) clearInterval(refVolDownInterval.current); + if(refAudio.current || refAudioAnnounce.current){ console.log('Fading out audio'); @@ -308,10 +310,9 @@ export function FreeFlow(){ if (audio.volume > 0) { audio.volume =Math.max(0, audio.volume - 1.0/(AUDIO_FADE_TIME/100)); // Decrease volume gradually } else { - clearInterval(fadeOutInterval); audio.pause(); audio.volume = 0; // Reset volume for next play - if(callback) callback(); + } } @@ -319,10 +320,15 @@ export function FreeFlow(){ if (announce.volume > 0) { announce.volume = Math.max(0, announce.volume - 1.0/(AUDIO_FADE_TIME/100)); // Decrease volume gradually } else { - clearInterval(fadeOutInterval); + //clearInterval(fadeOutInterval); announce.pause(); announce.volume = 0; // Reset volume for next play } + + if(audio?.volume==0 && announce?.volume==0){ + clearInterval(fadeOutInterval); + if(callback) callback(); + } }, 100); // Decrease volume every 100ms refFadeOutInterval.current=fadeOutInterval;