subx_cli/services/vad/mod.rs
1//! Local Voice Activity Detection (VAD) module.
2//!
3//! This module provides local voice detection functionality based on the
4//! `voice_activity_detector` crate, enabling fast and private voice activity
5//! detection and subtitle synchronization in local environments.
6//!
7//! # Key Components
8//!
9//! - [`VadAudioProcessor`] - Audio processing and format conversion
10//! - [`LocalVadDetector`] - Core VAD detection functionality
11//! - [`VadSyncDetector`] - Subtitle synchronization using VAD
12//!
13//! # Features
14//!
15//! - Local audio processing without external API calls
16//! - Configurable sensitivity and processing parameters
17//! - Support for multiple audio formats and sample rates
18//! - Privacy-focused design with no data transmission
19
20/// Audio loading utilities for VAD operations.
21///
22/// Provides direct audio file loading functionality with support for
23/// various audio formats and efficient memory management.
24pub mod audio_loader;
25/// Audio processing utilities for VAD operations.
26///
27/// Provides audio loading, resampling, and format conversion functionality
28/// specifically designed for voice activity detection workflows.
29pub mod audio_processor;
30/// Voice activity detection core functionality.
31///
32/// Contains the main VAD detector implementation using local processing
33/// to identify speech segments in audio files.
34pub mod detector;
35/// VAD-based subtitle synchronization.
36///
37/// Provides subtitle timing synchronization using voice activity detection
38/// to automatically align subtitle timing with detected speech segments.
39pub mod sync_detector;
40
41pub use audio_processor::{ProcessedAudioData, VadAudioProcessor};
42pub use detector::{LocalVadDetector, SpeechSegment, VadResult};
43pub use sync_detector::VadSyncDetector;
44
45// Re-export for convenience
46pub use crate::config::VadConfig;