feat: per-clip WakeWordProbe for benchmark/test harnesses#97
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greetings! The CI pipeline has delivered its findings. 🏗️I've aggregated the results of the automated checks for this PR below. 🔍 LintThe results are fresh out of the pipeline. 🏗️ ❌ ruff: issues found — see job log 📋 Repo HealthI've checked the repo's memory (aka git history). 🧠 ✅ All required files present. Latest Version: ✅ 🏷️ Release PreviewEvaluating the overall quality of the next release. ✨ Current:
✅ PR title follows conventional commit format. 🚀 Release Channel Compatibility Predicted next version:
📊 CoverageA bird's eye view of your test coverage landscape. 🦅 ❌ 53.7% total coverage Files below 80% coverage (18 files)
Full report: download the 🔒 Security (pip-audit)Ensuring our security headers are properly set. 🎩 ✅ No known vulnerabilities found (78 packages scanned). ⚖️ License CheckI've audited the copyright holders list. 👥 ✅ No license violations found. Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed. 🔨 Build TestsChecking if the architectural integrity holds up. 🏛️ ✅ All versions pass
Generated with ❤️ by OVOS Automations |
Add a self-contained probe that drives a real HotWordEngine over a single clip the way the listening loop does: a few seconds of leading silence to warm the engine's rolling feature window (openWakeWord et al. only emit once it is full, ~2.5 s — too little lead silently drops short positives and biases false rejects), then the clip streamed frame by frame, returning a detection decision plus latency and frames-to-detection. Unlike MiniVoiceLoop it needs no bus or [listener] extra — just the [bench] extra (numpy). Tolerates the HotWordEngine(lang) signature and the vestigial found_wake_word(frame) arg. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
04fc0a5 to
679b3e4
Compare
What
Adds
ovoscope/wakeword_probe.py— a lightweight, self-contained probe that drives a real OVOSHotWordEngineover a single audio clip and returns a per-clip detection decision, latency, and frames-to-detection.Why
Streaming detectors (openWakeWord, microWakeWord, …) only emit a prediction once their rolling mel/embedding window is full (~2.5 s of frames). A clip fed with too little leading silence never fills that window — the activation is missed (a false reject), and on the shortest clips the half-full buffer raises a shape mismatch that drops the sample entirely. The probe primes every clip with a few seconds of leading silence (
PRIME_SECONDS = 3.0) so the window is warm before the keyword arrives, exactly as a live mic keeps the loop warm, then streams the clip frame by frame (1280-sample chunks).Unlike
MiniVoiceLoop(which runs the fullDinkumVoiceLoopand needs the[listener]extra), this is bus-free, VAD-free, and needs only the new[bench]extra (numpy) — ideal for plugin test suites and benchmarks that score detection on labelled fixtures.It also tolerates the
HotWordEngine(key_phrase, config, lang)signature change and the vestigialfound_wake_word(frame_data)argument some plugins keep.Notes
import ovoscopestays light — numpy is imported lazily inside the probe.float32in[-1, 1]at the engine rate (16 kHz). Resample upstream.found_wake_wordsignatures, no-detection path.🤖 Generated with Claude Code