diff --git a/vite/public/assets/debug-1.mp3 b/vite/public/assets/debug-1.mp3 new file mode 100644 index 0000000..b5b0ad4 Binary files /dev/null and b/vite/public/assets/debug-1.mp3 differ diff --git a/vite/public/assets/debug-2.mp3 b/vite/public/assets/debug-2.mp3 new file mode 100644 index 0000000..de0d7f1 Binary files /dev/null and b/vite/public/assets/debug-2.mp3 differ diff --git a/vite/public/cuelist_0923.json b/vite/public/cuelist_0923.json index bb2529e..184a902 100644 --- a/vite/public/cuelist_0923.json +++ b/vite/public/cuelist_0923.json @@ -176,8 +176,7 @@ "auto": false, "audioFile": "assets/combine/Q6_管家announce_0919.mp3", "layer":"announce", - "fadeout": true, - "callback":"exportFile" + "fadeout": true }, { "id": 7, @@ -186,6 +185,33 @@ "description": "Ending", "status":"end", "callback":"fadeout" + }, + { + "id": 101, + "name": "Q101", + "type": "debug", + "description": "DEBUG_MODE", + "audioFile": "assets/debug-1.mp3", + "loop": true, + "status":"intro", + "callback":"numpad", + "nextcue": 102, + "numpad_type":"password" + }, + { + "id": 102, + "name": "Q102", + "type": "debug", + "description": "DEBUG_MODE", + "audioFile": "assets/debug-2.mp3", + "auto": true, + "nextcue": 103 + }, + { + "id": 103, + "name": "Q103", + "type": "chat", + "description": "DEBUG_MODE_CHAT" } ] } diff --git a/vite/src/pages/flow_free.jsx b/vite/src/pages/flow_free.jsx index 19c30ca..e58a68c 100644 --- a/vite/src/pages/flow_free.jsx +++ b/vite/src/pages/flow_free.jsx @@ -60,6 +60,8 @@ export function FreeFlow(){ const [padInput, setPadInput] = useState(null); + const [showMessage, setShowMessage] = useState(false); + const { userId, setUserId, getFileId, setPassword, reset:resetUser, uploadHistory, setSummary, summary,setChoice,choice, getUploadFolder,getDataId, writeSheet } = useUser(); const refTimer=useRef(); @@ -83,6 +85,7 @@ export function FreeFlow(){ const refHintTimeout=useRef(); const refFadeOutInterval=useRef(); + const refVolDownInterval=useRef(); const { history, status, reset, sendMessage, setStatus, audioOutput, setAudioOutput, stop:stopChat, audioUrl }=useChat(); @@ -183,6 +186,26 @@ export function FreeFlow(){ refAudioAnnounce.current.play().catch(error => { console.error("Audio announce playback error:", error); }); + + + // lower audio + if(refAudio.current) { + // fade out current audio + if(refVolDownInterval.current){ + clearInterval(refVolDownInterval.current); + } + + const dest=0.5; + let fadeOutInterval = setInterval(() => { + if (refAudio.current.volume > dest) { + refAudio.current.volume =Math.max(dest, refAudio.current.volume - 1.0/(AUDIO_FADE_TIME/100)); // Decrease volume gradually + } else { + clearInterval(fadeOutInterval); + } + }, 100); + refVolDownInterval.current=fadeOutInterval; + } + return; } @@ -659,6 +682,11 @@ export function FreeFlow(){ }); } + function blurText(text) { + if(!text) return ''; + return text.replace(/./g, '*'); + } + useEffect(()=>{ if(audioInput && isMicrophoneAvailable) { @@ -894,18 +922,18 @@ export function FreeFlow(){ -
-
+
+
{history?.map((msg, index) => (
-
{msg.content}
- {msg.prompt &&
{msg.prompt}
} +
{blurText(msg.content)}
+ {msg.prompt &&
{blurText(msg.prompt)}
}
))} {summary &&
{summary}
}