Skip to content

feat: per-clip WakeWordProbe for benchmark/test harnesses#97

Draft
JarbasAl wants to merge 1 commit into
devfrom
feat/wakeword-probe
Draft

feat: per-clip WakeWordProbe for benchmark/test harnesses#97
JarbasAl wants to merge 1 commit into
devfrom
feat/wakeword-probe

Conversation

@JarbasAl

Copy link
Copy Markdown
Member

What

Adds ovoscope/wakeword_probe.py — a lightweight, self-contained probe that drives a real OVOS HotWordEngine over a single audio clip and returns a per-clip detection decision, latency, and frames-to-detection.

from ovoscope.wakeword_probe import WakeWordProbe

probe = WakeWordProbe.from_plugin("ovos-ww-plugin-openwakeword", key_phrase="hey_mycroft")
result = probe.detect(clip)          # mono float32 @ 16 kHz
assert result.detected

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 full DinkumVoiceLoop and 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 vestigial found_wake_word(frame_data) argument some plugins keep.

Notes

  • Engine-agnostic; the engine itself is environmental (not a dependency).
  • import ovoscope stays light — numpy is imported lazily inside the probe.
  • Audio contract: mono float32 in [-1, 1] at the engine rate (16 kHz). Resample upstream.
  • Tests use a fake engine (no heavy deps): priming, frame streaming, reset, both found_wake_word signatures, no-detection path.

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@JarbasAl, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 18 minutes and 33 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fda8a2e7-1c37-4189-a016-f33ce15d654f

📥 Commits

Reviewing files that changed from the base of the PR and between 0cbdf53 and 04fc0a5.

📒 Files selected for processing (3)
  • ovoscope/wakeword_probe.py
  • pyproject.toml
  • test/unittests/test_wakeword_probe.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/wakeword-probe

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

Greetings! The CI pipeline has delivered its findings. 🏗️

I've aggregated the results of the automated checks for this PR below.

🔍 Lint

I've gathered the facts for your review. 📖

ruff: issues found — see job log

📋 Repo Health

Ensuring the repository remains in peak condition. 🏔️

✅ All required files present.

Latest Version: 1.0.0a1

ovoscope/version.py — Version file
README.md — README
LICENSE — License file
pyproject.toml — pyproject.toml
⚠️ setup.py — setup.py
CHANGELOG.md — Changelog
ovoscope/version.py has valid version block markers

🏷️ Release Preview

The roadmap for the future just got clearer. 🗺️

Current: 1.0.0a1Next: 1.1.0a1

Signal Value
Label (none)
PR title feat: per-clip WakeWordProbe for benchmark/test harnesses
Bump minor

✅ PR title follows conventional commit format.


🚀 Release Channel Compatibility

Predicted next version: 1.1.0a1

Channel Status Note Current Constraint
Stable Not in channel -
Testing Too new (must be <1.0.0) ovoscope>=0.7.2,<1.0.0
Alpha Compatible ovoscope>=0.22.1a1

📊 Coverage

A comprehensive review of our code coverage. 📖

⚠️ Coverage data unavailable — check the job log.

⚠️ Some tests failed — coverage figures may be incomplete.

🔒 Security (pip-audit)

Locking the doors and checking the windows... 🔒

✅ No known vulnerabilities found (72 packages scanned).

⚖️ License Check

Verifying the legal status of all dependencies. 📜

✅ No license violations found.

Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed.

🔨 Build Tests

Ensuring all components are in alignment. 📏

Python Build Install Tests
3.10 ⚠️
3.11 ⚠️
3.12 ⚠️
3.13 ⚠️
3.14 ⚠️

❌ 3.10: Install OK, tests failed
❌ 3.11: Install OK, tests failed
❌ 3.12: Install OK, tests failed
❌ 3.13: Install OK, tests failed
❌ 3.14: Install OK, tests failed
Check job logs for details.


Generated with ❤️ by OVOS Automations

@JarbasAl JarbasAl marked this pull request as draft June 27, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant