diff --git a/vite/public/cuelist_0923.json b/vite/public/cuelist_0923.json index be4b2f5..f14aef8 100644 --- a/vite/public/cuelist_0923.json +++ b/vite/public/cuelist_0923.json @@ -55,17 +55,18 @@ "id": 4.1, "name": "Q4.1", "type": "phone", - "description": "輸入完成,請描述腦中的記憶畫面", + "description": "撥打音效", "auto": false, "audioFile": "assets/combine/Q4-1_撥打音效.mp3", "loop": true, - "nextcue": 4.11 + "nextcue": 4.11, + "fadeout": true }, { "id": 4.11, "name": "Q4.11", "type": "phone", - "description": "裝置啟動音效", + "description": "裝置啟動", "auto": true, "audioFile": "assets/combine/Q4-1-1.mp3", "nextcue": 4.2, diff --git a/vite/src/pages/flow_free.jsx b/vite/src/pages/flow_free.jsx index e4ea862..b28100c 100644 --- a/vite/src/pages/flow_free.jsx +++ b/vite/src/pages/flow_free.jsx @@ -321,16 +321,17 @@ export function FreeFlow(){ } } - if(!announce) return; - if (announce.volume > 0) { - announce.volume = Math.max(0, announce.volume - 1.0/(AUDIO_FADE_TIME/100)); // Decrease volume gradually - } else { - //clearInterval(fadeOutInterval); - announce.pause(); - announce.volume = 0; // Reset volume for next play + if(announce){ + if (announce.volume > 0) { + announce.volume = Math.max(0, announce.volume - 1.0/(AUDIO_FADE_TIME/100)); // Decrease volume gradually + } else { + //clearInterval(fadeOutInterval); + announce.pause(); + announce.volume = 0; // Reset volume for next play + } } - if(audio?.volume==0 && announce?.volume==0){ + if((audio==null || audio.volume==0) && (announce==null || announce.volume==0)){ clearInterval(fadeOutInterval); if(callback) callback(); } @@ -517,11 +518,9 @@ export function FreeFlow(){ } - if(cue.hint!=null && cue.hint_time==null){ - sendOsc(OSC_ADDRESS.HINT, cue.hint); // Send OSC hint message - }else{ - sendOsc(OSC_ADDRESS.HINT, ''); // Clear hint message - } + + sendOsc(OSC_ADDRESS.HINT, ''); // Clear hint message + sendOsc(OSC_ADDRESS.SPEECH, 'stop'); if(cue.numpad_type=='choice'){ @@ -710,7 +709,7 @@ export function FreeFlow(){ useEffect(()=>{ - // console.log('Final transcript changed:', finalTranscript); + console.log('Final transcript changed:', finalTranscript); if(finalTranscript.trim().length > 0) { onSpeechEnd(); }