feat: kiosk always-on mic — auto-start voice on kiosk entry, no sleep, no wake word needed

This commit is contained in:
2026-06-21 04:55:29 +00:00
parent 572f1b1816
commit f1d73e7b6a
3 changed files with 18 additions and 9 deletions
+10 -2
View File
@@ -161,7 +161,7 @@ function showApp(name, greeting, silent = false) {
}
}, 30000);
setInterval(() => {
if (voiceMode && voiceLastCmd > 0 && Date.now() - voiceLastCmd > VOICE_SLEEP_MS) {
if (voiceMode && !document.body.classList.contains(kiosk-mode) && voiceLastCmd > 0 && Date.now() - voiceLastCmd > VOICE_SLEEP_MS) {
exitVoiceMode();
}
}, 60000);
@@ -1322,11 +1322,15 @@ function initVoice() {
// Sleeping: ONLY respond to master wake phrases
if (isAsleep) {
if (WAKE_PHRASES.some(p => lc.includes(p))) wakeFromSleep();
return;
// In kiosk mode: wake word also wakes from sleep
if (document.body.classList.contains("kiosk-mode")) { wakeFromSleep(); }
else return;
}
if (!voiceMode) {
if (WAKE_PHRASES.some(p => lc.includes(p))) enterVoiceMode();
// Kiosk: any speech enters conversation mode
else if (document.body.classList.contains("kiosk-mode") && transcript.length > 2) enterVoiceMode("kiosk");
} else if (!voiceMuted) {
voiceLastCmd = Date.now();
voiceActive = Date.now();
@@ -1800,6 +1804,10 @@ async function toggleKiosk() {
switchTab("intel");
}
if (btn) { btn.textContent = "⧞ EXIT"; btn.style.color = "var(--cyan)"; }
// Kiosk: auto-start mic and enter always-on conversation mode
if (isAsleep) wakeFromSleep();
if (!voiceMode) enterVoiceMode("kiosk");
if (!isListening) { isListening = true; updateMicBtn(); if (recognition) try { recognition.start(); } catch(_) {} }
} else {
const ex = document.exitFullscreen || document.webkitExitFullscreen || document.mozCancelFullScreen || document.msExitFullscreen;
if (ex) ex.call(document).catch(() => {});
+1
View File
@@ -6,6 +6,7 @@ var SLEEP_CMDS = /\b(good\s*night(\s*jarvis)?|go\s*to\s*sleep|sleep\s*mode|shut\
function enterSleepMode() {
if (isAsleep) return;
if (document.body.classList.contains("kiosk-mode")) return; // never sleep in kiosk
isAsleep = true;
// Pause voice mode