Detection threshold
Production and offline tests use the same rule: score ≥ workflow threshold (default 0.5). The Wake Word node exposes one Threshold field in the editor — it applies to all selected models (alexa, hey_jarvis, etc.), not per model.
Pass --threshold to offline tools to mirror the value saved on the node:
| Model (fixture) | Typical peak on committed WAV | Often works at default 0.5? |
|---|---|---|
alexa | ~1.0 | Yes |
hey_mycroft | ~0.68 | Yes |
hey_jarvis | ~0.41 | Often no — try 0.35–0.40 |
Offline WAV test (edge worker)
Use a recording that contains the wake phrase (e.g. someone saying “alexa”). Copy into the worker container and run the bundled script:- Resamples any WAV rate/channels to 16 kHz mono int16
- Scores 80 ms frames (1,280 samples)
- Uses the same
Model(wakeword_models=[...])keys as production
Django management command (compile host)
Ifopenwakeword is installed on the backend container:
cyberwave-backend/src/app/tests/fixtures/audio/ cover alexa, hey_mycroft, and hey_jarvis.
- Pytest (
test_wake_word_wav_detection.py,@pytest.mark.integration): asserts each fixture reaches an expected peak score (not that 0.5 always fires for every model). - If
hey_jarvisat--threshold 0.5printsNo frame reached threshold, lower--thresholdto match your workflow node or inspectmax_scorein the summary line.
Live workflow checklist
| Check | Expected |
|---|---|
| Audio Track buffer | Wake Word (80 ms) — codegen shows _CwAudioFifoBuffer(1280) |
| Worker init log | wake_words=['alexa'] prediction_keys=['alexa'] |
| Say wake phrase | Wake word detected: 'alexa' scores={'alexa': 0.5+} |
| Send Alert downstream | Alert name = detected wake word |
| Assistant signaling | start_assistant / stop_assistant on twin MQTT topic |
Common failures
| Symptom | Cause | Fix |
|---|---|---|
| No detection, scores always 0 | Stale worker using alexa_v0.1 prediction keys | Recompile + sync |
| Scores rise but never cross threshold | Threshold too high for that model (common with hey_jarvis at 0.5) | Lower Detection Threshold on the node; confirm with test_wake_word_wav and max_score |
| No logs from wake word node | Audio Track 4 s buffer | Set Wake Word (80 ms) buffer |
Could not find pretrained model hey_siri | Removed model still in saved params | Re-save node; pick a built-in word |
| Compile error: openwakeword not installed | Django image lacks ml-wakeword | Install on compile host or compile from CI with deps |
| No assistant sounds | Twin not set on Wake Word node or FE not on environment | Enable signaling + select microphone twin |
Log levels
Regression tests (repo)
Backend (Docker):test_wake_word_wav_detection.py (marked @pytest.mark.integration).