Skip to content

fix(#1057): fast-open VAD gate for wake word detection#1068

Merged
NickMonrad merged 2 commits into
mainfrom
feature/vad-gating-wakeword
Jun 2, 2026
Merged

fix(#1057): fast-open VAD gate for wake word detection#1068
NickMonrad merged 2 commits into
mainfrom
feature/vad-gating-wakeword

Conversation

@lokhor
Copy link
Copy Markdown
Collaborator

@lokhor lokhor commented Jun 2, 2026

Problem

Wake word detection is inconsistent — often need to say "hey jandal" 2-3 times. The VAD gate requires 3 consecutive frames (240ms) above RMS threshold before opening, causing the classifier to miss speech onset. During gated silence, inference runs only once every 3 seconds.

Fix

Three changes to OnnxWakeWordDetector.kt + WakeWordPreferences.kt:

  1. Fast-open gate: A single above-threshold frame immediately resets the silence counter, opening the gate in 80ms instead of 240ms
  2. Slow-close: Silence timer only starts accumulating after 3 consecutive silent frames
  3. Lower VAD threshold: silenceRmsThreshold 600→300 to catch quieter speech at normal distance
  4. Frequent periodic check: maxSilenceSkipSeconds 3.0→1.0 during gated silence

Oracle code review: no correctness issues.

Test results

  • :core:voice:test
  • :core:voice:compileDebugKotlin

@lokhor lokhor force-pushed the feature/vad-gating-wakeword branch from d5012aa to 2ed6187 Compare June 2, 2026 10:36
- Replace 3-frame debounce open with fast-open/slow-close semantics:
  a single above-threshold frame immediately resets silence counter
  (opens gate in 80ms instead of 240ms)
- Keep 3-frame debounce for closing: only after 3 consecutive silent
  frames does the silence timer begin accumulating
- Lower silenceRmsThreshold 600->300 to catch quieter speech
- Reduce maxSilenceSkipSeconds 3.0->1.0 for more frequent periodic
  checks during gating
- Update WakeWordSilenceGateTest for new 1s skip interval
@lokhor lokhor force-pushed the feature/vad-gating-wakeword branch from 2ed6187 to d92fcca Compare June 2, 2026 10:56
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Debug APK ready

Download app-debug.apk

Commit: c51da04 - Build #2075

Updated on each push. Removed when PR is merged or closed.

@NickMonrad NickMonrad merged commit 0d2189c into main Jun 2, 2026
1 check passed
@NickMonrad NickMonrad deleted the feature/vad-gating-wakeword branch June 2, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants