Skip to content

feat: acoustic shush detection for instant TTS interruption#151

Draft
isair wants to merge 1 commit intodevelopfrom
claude/confident-engelbart
Draft

feat: acoustic shush detection for instant TTS interruption#151
isair wants to merge 1 commit intodevelopfrom
claude/confident-engelbart

Conversation

@isair
Copy link
Copy Markdown
Owner

@isair isair commented Apr 7, 2026

Summary

  • Add a spectral fricative detector (ShushDetector) that runs on raw audio frames during TTS playback, detecting "shhh" sounds in ~300ms without waiting for Whisper transcription
  • Analyses each 20ms frame's frequency profile — shush has high energy in 2–8 kHz with little below 500 Hz (no harmonics); requires 15 consecutive frames to trigger, avoiding false positives from brief sibilants in TTS output
  • Reduces TTS stop latency from ~1.5–3s (Whisper pipeline) to ~300ms (direct spectral check)

Test plan

  • Run unit tests: pytest tests/test_shush_detector.py -v
  • Manual test: start Jarvis, trigger a long TTS response, then make a sustained "shhh" sound — TTS should stop within ~300ms
  • Verify brief "s"/"sh" sounds in normal speech or TTS output don't trigger false positives
  • Test with shush_detection_enabled: false in config to confirm it can be disabled
  • Tune shush_consecutive_frames and shush_energy_floor if needed for different mic setups

🤖 Generated with Claude Code

Add a spectral fricative detector that runs directly on raw audio frames
during TTS playback, enabling sub-300ms "shhh" detection without waiting
for Whisper transcription. The detector analyses each 20ms frame's
frequency profile — a shush has high energy in 2–8 kHz with little
below 500 Hz. Sustained detection across 15 consecutive frames (300ms)
triggers an immediate TTS interrupt, avoiding false positives from brief
sibilants in speech.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@isair isair marked this pull request as draft April 7, 2026 12:41
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.

1 participant