Skip to content

Commit 9e5a6b9

Browse files
authored
reserve buffer capacity (#58)
1 parent 8f7cc8c commit 9e5a6b9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ impl VadSession {
174174
Self::new_from_bytes(model_bytes, config)
175175
}
176176

177+
/// Reserve the session audio buffer size by number of samples
178+
pub fn reserve_audio_buffer(&mut self, samples: usize) {
179+
self.session_audio.reserve(samples);
180+
}
181+
177182
pub fn validate_input(&self, audio_frame: &[f32]) -> Result<()> {
178183
if audio_frame
179184
.iter()

0 commit comments

Comments
 (0)