mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
feat: kiosk always-on mic — auto-start voice on kiosk entry, no sleep, no wake word needed
This commit is contained in:
@@ -161,7 +161,7 @@ function showApp(name, greeting, silent = false) {
|
|||||||
}
|
}
|
||||||
}, 30000);
|
}, 30000);
|
||||||
setInterval(() => {
|
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();
|
exitVoiceMode();
|
||||||
}
|
}
|
||||||
}, 60000);
|
}, 60000);
|
||||||
@@ -1322,11 +1322,15 @@ function initVoice() {
|
|||||||
// Sleeping: ONLY respond to master wake phrases
|
// Sleeping: ONLY respond to master wake phrases
|
||||||
if (isAsleep) {
|
if (isAsleep) {
|
||||||
if (WAKE_PHRASES.some(p => lc.includes(p))) wakeFromSleep();
|
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 (!voiceMode) {
|
||||||
if (WAKE_PHRASES.some(p => lc.includes(p))) enterVoiceMode();
|
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) {
|
} else if (!voiceMuted) {
|
||||||
voiceLastCmd = Date.now();
|
voiceLastCmd = Date.now();
|
||||||
voiceActive = Date.now();
|
voiceActive = Date.now();
|
||||||
@@ -1800,6 +1804,10 @@ async function toggleKiosk() {
|
|||||||
switchTab("intel");
|
switchTab("intel");
|
||||||
}
|
}
|
||||||
if (btn) { btn.textContent = "⧞ EXIT"; btn.style.color = "var(--cyan)"; }
|
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 {
|
} else {
|
||||||
const ex = document.exitFullscreen || document.webkitExitFullscreen || document.mozCancelFullScreen || document.msExitFullscreen;
|
const ex = document.exitFullscreen || document.webkitExitFullscreen || document.mozCancelFullScreen || document.msExitFullscreen;
|
||||||
if (ex) ex.call(document).catch(() => {});
|
if (ex) ex.call(document).catch(() => {});
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ var SLEEP_CMDS = /\b(good\s*night(\s*jarvis)?|go\s*to\s*sleep|sleep\s*mode|shut\
|
|||||||
|
|
||||||
function enterSleepMode() {
|
function enterSleepMode() {
|
||||||
if (isAsleep) return;
|
if (isAsleep) return;
|
||||||
|
if (document.body.classList.contains("kiosk-mode")) return; // never sleep in kiosk
|
||||||
isAsleep = true;
|
isAsleep = true;
|
||||||
|
|
||||||
// Pause voice mode
|
// Pause voice mode
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<title>JARVIS — Integrated Defense and Logistics System</title>
|
<title>JARVIS — Integrated Defense and Logistics System</title>
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com"/>
|
<link rel="preconnect" href="https://fonts.googleapis.com"/>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Rajdhani:wght@300;400;500;600&family=Share+Tech+Mono&display=swap" rel="stylesheet"/>
|
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Rajdhani:wght@300;400;500;600&family=Share+Tech+Mono&display=swap" rel="stylesheet"/>
|
||||||
<link rel="stylesheet" href="assets/css/jarvis.css?v=20260621c"/>
|
<link rel="stylesheet" href="assets/css/jarvis.css?v=20260621d"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<canvas id="particleCanvas"></canvas>
|
<canvas id="particleCanvas"></canvas>
|
||||||
@@ -426,12 +426,12 @@
|
|||||||
style="position:fixed;top:-9999px;left:-9999px;width:320px;height:240px"></video>
|
style="position:fixed;top:-9999px;left:-9999px;width:320px;height:240px"></video>
|
||||||
<script data-cfasync="false" src="https://cdn.jsdelivr.net/npm/face-api.js@0.22.2/dist/face-api.min.js" crossorigin="anonymous"></script>
|
<script data-cfasync="false" src="https://cdn.jsdelivr.net/npm/face-api.js@0.22.2/dist/face-api.min.js" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
<script data-cfasync="false" src="assets/js/jarvis-effects.js?v=20260621c"></script>
|
<script data-cfasync="false" src="assets/js/jarvis-effects.js?v=20260621d"></script>
|
||||||
<script data-cfasync="false" src="assets/js/jarvis-overlays.js?v=20260621c"></script>
|
<script data-cfasync="false" src="assets/js/jarvis-overlays.js?v=20260621d"></script>
|
||||||
<script data-cfasync="false" src="assets/js/jarvis-app.js?v=20260621c"></script>
|
<script data-cfasync="false" src="assets/js/jarvis-app.js?v=20260621d"></script>
|
||||||
<script data-cfasync="false" src="assets/js/panels/jarvis-arc.js?v=20260621c"></script>
|
<script data-cfasync="false" src="assets/js/panels/jarvis-arc.js?v=20260621d"></script>
|
||||||
<script data-cfasync="false" src="assets/js/panels/jarvis-agents.js?v=20260621c"></script>
|
<script data-cfasync="false" src="assets/js/panels/jarvis-agents.js?v=20260621d"></script>
|
||||||
<script data-cfasync="false" src="assets/js/panels/jarvis-assistant.js?v=20260621c"></script>
|
<script data-cfasync="false" src="assets/js/panels/jarvis-assistant.js?v=20260621d"></script>
|
||||||
|
|
||||||
<!-- VISION LIGHTBOX -->
|
<!-- VISION LIGHTBOX -->
|
||||||
<div id="vision-lightbox">
|
<div id="vision-lightbox">
|
||||||
|
|||||||
Reference in New Issue
Block a user