Skip to content

Commit

Permalink
fix mimicry.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
carrotflakes committed Jul 9, 2023
1 parent 4140f4f commit 82e18f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/mimicry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ impl MimicryProcessor {
}
if self.buf.len() > (self.sample_rate * 10.0) as usize {
self.mode = Mode::Speak;
self.buf = (self.process)(&self.buf);
}
vec![0.0; buf.len()]
}
Expand All @@ -111,6 +112,7 @@ fn root_mean_square(buf: &[f32]) -> f32 {
(buf.iter().map(|&x| x * x).sum::<f32>() / buf.len() as f32).sqrt()
}

#[allow(dead_code)]
fn count_zero_cross(buf: &[f32]) -> usize {
let mut last = buf[0];
let mut count = 0;
Expand Down

0 comments on commit 82e18f2

Please sign in to comment.