30 lines
788 B
Python
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()
|