Files
Lumotia/crates/audio/src/vad.rs
jake 0646c75de7 fix(kon): resolve ort version conflict — stub VAD, fix audio crate
- VAD stubbed: voice_activity_detector and silero-vad-rust both pin ort rc.10
  which conflicts with transcribe-rs requiring ort rc.12. Stubbed until ort
  ecosystem aligns at 2.0.0 stable. All audio treated as speech (matches v0.2).
- Refreshed Cargo.lock to resolve ort rc.12 + whisper-rs 0.16 correctly
- clippy clean

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 21:09:38 +00:00

36 lines
942 B
Rust

// Voice Activity Detection — stubbed.
//
// Both `voice_activity_detector` and `silero-vad-rust` pin ort 2.0.0-rc.10
// which conflicts with transcribe-rs requiring ort 2.0.0-rc.12.
// When the ort ecosystem aligns (likely at 2.0.0 stable), add Silero VAD here.
//
// For now, all audio is treated as speech. This matches v0.2 behaviour
// (no VAD) and doesn't affect core functionality.
use kon_core::constants::VAD_SPEECH_THRESHOLD;
/// Stub speech detector. Treats all audio as speech.
#[derive(Default)]
pub struct SpeechDetector {
threshold: f64,
}
impl SpeechDetector {
pub fn new() -> Self {
Self {
threshold: VAD_SPEECH_THRESHOLD,
}
}
/// Always returns true (no VAD filtering until ort conflict resolved).
pub fn is_speech(&self, _samples: &[f32]) -> bool {
true
}
pub fn threshold(&self) -> f64 {
self.threshold
}
pub fn reset(&mut self) {}
}