Skip to content

Commit

Permalink
Remove unneeded functions (#18)
Browse files Browse the repository at this point in the history
Before we took durations in things these functions were used a bit
internally but now they're no longer needed so deleting them!
  • Loading branch information
xd009642 authored Aug 28, 2024
1 parent 1985a7c commit 00fccb2
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@ pub struct VadConfig {
pub min_speech_time: Duration,
}

impl VadConfig {
/// Gets the number of audio samples in an input frame
pub fn get_frame_samples(&self) -> usize {
(30_f32 / 1000_f32 * self.sample_rate as f32) as usize // 30ms * sample_rate Hz
}

/// Gets the number of frames for a given duration in milliseconds
pub fn get_frames(length_ms: usize) -> usize {
length_ms / 30
}
}

/// A VAD session create one of these for each audio stream you want to detect voice activity on
/// and feed the audio into it.
#[derive(Debug)]
Expand Down

0 comments on commit 00fccb2

Please sign in to comment.