-
-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Hotword verifier #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
WalkthroughAdds wake-word verifier plugin support: service loads verifier plugins and passes instances to HotwordContainer; HotwordContainer exposes a verify method; the voice loop aggregates hotword audio and gates detections through verify. Dependency pins and README verifier config were updated. Changes
Sequence Diagram(s)sequenceDiagram
participant HW as Hotword Detector
participant VL as Voice Loop
participant HC as HotwordContainer
participant VER as Verifier Plugins
participant CB as Callbacks
HW->>VL: hotword detected (chunks)
VL->>VL: aggregate hotword_audio_bytes
rect rgb(235,244,255)
Note over VL,HC: Verification gate (new)
VL->>HC: verify(hotword_audio_bytes)
HC->>VER: iterate verifiers
VER-->>HC: pass / fail
alt any fails
HC-->>VL: False
VL->>VL: discard detection
else all pass
HC-->>VL: True
VL->>CB: listenword_audio_callback(hotword_audio_bytes)
end
end
VL->>CB: wake_callback(...)
VL->>VL: state transition
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
ovos_dinkum_listener/service.py(3 hunks)ovos_dinkum_listener/voice_loop/hotwords.py(3 hunks)ovos_dinkum_listener/voice_loop/voice_loop.py(2 hunks)requirements/extras.txt(1 hunks)requirements/onnx.txt(0 hunks)requirements/requirements.txt(1 hunks)setup.py(0 hunks)
💤 Files with no reviewable changes (2)
- requirements/onnx.txt
- setup.py
🧰 Additional context used
🧬 Code graph analysis (2)
ovos_dinkum_listener/service.py (1)
ovos_dinkum_listener/voice_loop/hotwords.py (1)
HotwordContainer(98-357)
ovos_dinkum_listener/voice_loop/voice_loop.py (1)
ovos_dinkum_listener/voice_loop/hotwords.py (2)
clear(33-37)verify(304-309)
🪛 Ruff (0.14.3)
ovos_dinkum_listener/service.py
200-200: Do not catch blind exception: Exception
(BLE001)
200-200: Local variable e is assigned to but never used
Remove assignment to unused variable e
(F841)
ovos_dinkum_listener/voice_loop/hotwords.py
102-102: Do not perform function call FakeBus in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
(B008)
57742e9 to
529ff1a
Compare
529ff1a to
be0f092
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
README.md (1)
49-49: Fix JSON syntax error.The opening quote is missing for the "VAD" key, making this an invalid JSON example.
Apply this diff:
- VAD": { + "VAD": {
♻️ Duplicate comments (2)
ovos_dinkum_listener/service.py (2)
204-207: Respect the same enable flag when reporting missing verifiers.The loading logic at line 195 checks
cfg.get("enabled", True), but the missing-plugin warning here checksv.get("active", True). This inconsistency causes false warnings when users set"enabled": falseto deliberately disable a verifier. Please use the same enable flag in both locations.Based on past review comments.
191-209: Reload verifiers when configuration changes.Wake-word verifier plugins are instantiated only once during service initialization. The
reload_configurationmethod (lines 1071-1171) reloads hotwords, STT, and other components when config changes, but never refreshes verifiers. This means changes tolistener.ww_verifiersconfig (enable/disable, threshold adjustments) have no effect until the entire service is restarted. Please extract verifier loading into a helper method and call it both here and withinreload_configurationafter the new config is read, assigning the fresh verifier list toself.hotwords.verifiers.Based on past review comments.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
README.md(1 hunks)ovos_dinkum_listener/service.py(3 hunks)ovos_dinkum_listener/voice_loop/hotwords.py(3 hunks)ovos_dinkum_listener/voice_loop/voice_loop.py(2 hunks)requirements/extras.txt(1 hunks)requirements/requirements.txt(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- requirements/extras.txt
🧰 Additional context used
🧬 Code graph analysis (2)
ovos_dinkum_listener/service.py (1)
ovos_dinkum_listener/voice_loop/hotwords.py (2)
get(71-75)HotwordContainer(98-357)
ovos_dinkum_listener/voice_loop/voice_loop.py (1)
ovos_dinkum_listener/voice_loop/hotwords.py (2)
plugins(222-223)verify(304-309)
🪛 Ruff (0.14.3)
ovos_dinkum_listener/service.py
200-200: Do not catch blind exception: Exception
(BLE001)
200-200: Local variable e is assigned to but never used
Remove assignment to unused variable e
(F841)
ovos_dinkum_listener/voice_loop/hotwords.py
102-102: Do not perform function call FakeBus in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
(B008)
🔇 Additional comments (3)
ovos_dinkum_listener/voice_loop/voice_loop.py (1)
558-566: LGTM!The verification gate is cleanly implemented. Audio is assembled from chunks once, verified through the plugin chain, and detection is discarded early if any verifier fails. This prevents false wake-word callbacks while maintaining efficient processing.
ovos_dinkum_listener/voice_loop/hotwords.py (1)
102-110: LGTM!The verifier integration is well-implemented. The
verifiersparameter follows best practices with a None default, and theverifymethod provides clear fail-fast semantics—returning False on the first verification failure and True only if all verifiers pass.Also applies to: 304-309
requirements/requirements.txt (1)
1-1: The alpha version requirement is justified by the new wake word verifier feature.The version bump to >=2.1.0a1 is directly tied to the "ww verifier" feature introduced in this commit (be0f092), which requires new
find_wake_word_verifier_plugins()APIs that don't exist in the stable 1.0.3 release. The feature is now actively used in service.py and voice_loop.py, and is documented in the README. This is intentional, coordinated development with upstream ovos-plugin-manager (PR #341).However, since you're depending on an alpha version, monitor upstream releases for a stable 2.1.0 final version to transition away from the prerelease.
90146fd to
f7e1b05
Compare
allow multiple plugins to perform checks on wake word audio, and discard the detection
this can be used to reduce false negatives, either with something like VAD, or with speaker verification.
config example
NOTE: usually you would enable either
ovos-ww-verifier-sileroor set"vad_pre_wake_enabled" true, not bothSummary by CodeRabbit
New Features
Documentation
Chores