• 2 Posts
  • 341 Comments
Joined 11 months ago
cake
Cake day: July 24th, 2023

help-circle














  • The new version seems to fix that since your comment was written, but it will stil panics if less than 2 samples are provided, unless the crate it wraps panics at an earlier point.

    let peak = buf
                .iter()
                .copied()
                .enumerate()
                .take(self.sample_count / 2)
                .max_by_key(|(_, s)| (s.abs() * 1000.0) as u32)
                .expect("to have at least 1 sample");