|
|
|
|
@ -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(); |
|
|
|
|
} |
|
|
|
|
|