Expand description
Silence detection and trimming utilities
Detects silent regions in audio and trims leading/trailing silence.
Algorithm:
- Frame audio into chunks
- Compute RMS energy per frame
- Mark frames below threshold as silent
- Merge consecutive silent frames (< 500ms)
- Trim leading/trailing silence
§Example
use stratum_dsp::preprocessing::silence::{detect_and_trim, SilenceDetector};
let samples = vec![0.0f32; 44100 * 5]; // 5 seconds
let detector = SilenceDetector::default();
let (trimmed, silence_map) = detect_and_trim(&samples, 44100, detector)?;Structs§
- Silence
Detector - Silence detection configuration
- Silence
Region - Silence region information
Functions§
- detect_
and_ trim - Detect and trim silence from audio