|
|
|
|
@ -93,6 +93,7 @@ export function FreeFlow(){ |
|
|
|
|
|
|
|
|
|
reset(); |
|
|
|
|
sendOsc(OSC_ADDRESS.CHOICE, 'reset'); |
|
|
|
|
sendOsc(OSC_ADDRESS.SPEECH, 'stop'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function onOsc(payload){ |
|
|
|
|
@ -233,6 +234,9 @@ export function FreeFlow(){ |
|
|
|
|
|
|
|
|
|
if(!cue) return; |
|
|
|
|
console.log('Playing cue:', cue); |
|
|
|
|
|
|
|
|
|
// stop audio |
|
|
|
|
if(refAudio.current) refAudio.current.pause(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -437,6 +441,8 @@ export function FreeFlow(){ |
|
|
|
|
|
|
|
|
|
function onSpeechEnd(){ |
|
|
|
|
|
|
|
|
|
sendOsc(OSC_ADDRESS.SPEECH, 'stop'); |
|
|
|
|
|
|
|
|
|
if(currentCue?.type!='chat') return; // Only process if current cue is user input |
|
|
|
|
if(chatStatus!=ChatStatus.User) return; // Only process if chat status is User |
|
|
|
|
|
|
|
|
|
@ -555,9 +561,11 @@ export function FreeFlow(){ |
|
|
|
|
if(refPauseTimer.current) clearTimeout(refPauseTimer.current); |
|
|
|
|
refSpeechPaused.current=false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sendOscStatus(OSC_ADDRESS.CLIENT_INPUT, `${data.id}#${transcript}`); // Send current input via OSC |
|
|
|
|
|
|
|
|
|
sendOscStatus(OSC_ADDRESS.CLIENT_INPUT, `${data.id}#${transcript}`); |
|
|
|
|
// Send current input via OSC |
|
|
|
|
} |
|
|
|
|
sendOsc(OSC_ADDRESS.SPEECH, 'start'); |
|
|
|
|
|
|
|
|
|
},[transcript]); |
|
|
|
|
|
|
|
|
|
@ -626,6 +634,8 @@ export function FreeFlow(){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
playCue(next); |
|
|
|
|
setNextCue(null); |
|
|
|
|
} |
|
|
|
|
|