1 unstable release

0.1.0 Sep 29, 2024

#6 in #voice-activity

Download history 4/week @ 2025-09-25 3/week @ 2025-10-02 2/week @ 2025-10-09 36/week @ 2025-10-16 88/week @ 2025-10-23 289/week @ 2025-10-30 29/week @ 2025-11-06 63/week @ 2025-11-13 585/week @ 2025-11-20 513/week @ 2025-11-27 203/week @ 2025-12-04 118/week @ 2025-12-11 140/week @ 2025-12-18 108/week @ 2025-12-25 98/week @ 2026-01-01

478 downloads per month
Used in hyprwhspr-rs

BSD-3-Clause

66KB
1K SLoC

Earshot is a fast voice activity detection library.

For more details, see VoiceActivityDetector.

use earshot::{VoiceActivityDetector, VoiceActivityProfile};

let mut vad = VoiceActivityDetector::new(VoiceActivityProfile::VERY_AGGRESSIVE);

while let Some(frame) = stream.next() {
	let is_speech_detected = vad.predict_16khz(&frame).unwrap();
	# assert_eq!(is_speech_detected, false);
}

Earshot

Ridiculously fast, only slightly bad voice activity detection in pure Rust. Port of the famous WebRTC VAD.

Features

  • #![no_std], doesn't even require alloc
    • Internal buffers can get pretty big when stored on the stack, so the alloc feature is enabled by default, which allocates them on the heap instead.
  • Stupidly fast; uses only fixed-point arithmetic
    • Achieves an RTF of ~3e-4 with 30 ms 48 KHz frames, ~3e-5 with 30 ms 8 KHz frames.
    • Comparatively, Silero VAD v4 w/ ort achieves an RTF of ~3e-3 with 60 ms 16 KHz frames.
  • Okay accuracy
    • Great at distinguishing between silence and noise, but not between noise and speech.
    • Earshot provides alternative models with slight accuracy gains compared to the base WebRTC model.

No runtime deps