Files
jarvis/scripts/test_wakeword.py
T
Adolfo Reyna 199f762616 feat: Jarvis v2 - CPU optimized always-listening for iMac Ubuntu
- PipeWire/pw-record backend (no PortAudio needed) - tested mic live
- VAD: Energy (immediate) + Silero (torch CPU) switchable
- Wakeword: openWakeWord TFLite hey_jarvis 0.4
- STT: faster-whisper base int8 CPU - model loads OK on i3
- SpeakerID: ECAPA embeddings + fallback stats, enrollment store
- Vision: OpenCV Haar + face_recognition + webcam cam0 640x480 verified
- LLM: ollama/qwen2.5:3b, gemini_cli, hermes_api, echo strategies
- TTS: Piper + espeak + echo fallbacks
- Core pipeline: IDLE -> WAKE -> RECORDING -> STT -> SpeakerID/FaceID fusion -> LLM -> TTS -> followup window
- Config via jarvis.yaml, soul.md persona
- CLI tools: run, devices, enroll-speaker, enroll-face, test-vad, test-mic
- Systemd user service ready
- Tested on iMac 2010 i3 550 15GB Ubuntu 26.04 CPU-only
2026-07-10 12:16:03 -04:00

30 lines
788 B
Python

"""Test wakeword detection without full pipeline"""
from jarvis.audio.capture import AudioCapture
from jarvis.audio.wakeword import WakeWordDetector
from jarvis.audio.vad import create_vad
from jarvis.config import load_config
import time
cfg = load_config(None)
vad = create_vad(cfg)
ww = WakeWordDetector(models=cfg.get('wakeword',{}).get('models',['hey_jarvis']), threshold=0.45)
cap = AudioCapture()
cap.start()
print("Say 'Hey Jarvis'...")
try:
while True:
chunk = cap.read(timeout=0.1)
if chunk is None:
continue
# Optional VAD gate
if not vad.is_speech(chunk):
continue
det = ww.detect(chunk)
if det:
print(f"Wake detected: {det}")
except KeyboardInterrupt:
pass
finally:
cap.stop()