diff --git a/vite/package.json b/vite/package.json index 9133816..07a23df 100644 --- a/vite/package.json +++ b/vite/package.json @@ -7,7 +7,8 @@ "dev": "vite", "build": "vite build", "lint": "eslint .", - "preview": "vite preview" + "preview": "vite preview", + "deploy":"tauri build && copy /Y src-tauri\\target\\release\\app.exe C:\\uc\\24070-Sync\\app.exe" }, "dependencies": { "@tailwindcss/vite": "^4.1.8", diff --git a/vite/src/pages/flow_free.jsx b/vite/src/pages/flow_free.jsx index 6a8741c..18fa2de 100644 --- a/vite/src/pages/flow_free.jsx +++ b/vite/src/pages/flow_free.jsx @@ -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); } diff --git a/vite/src/util/osc.js b/vite/src/util/osc.js index 138df1f..4240da7 100644 --- a/vite/src/util/osc.js +++ b/vite/src/util/osc.js @@ -17,6 +17,7 @@ export const OSC_ADDRESS={ DISCARD: 'discard', PASSWORD: '/password', HINT:'/hint', + SPEECH:'/speech', CLIENT_STATUS:'/client', CLIENT_INPUT:'/client_input',