Skip to content

Commit

Permalink
recording: add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
phip1611 committed May 4, 2024
1 parent 1080c75 commit ef0d9df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/stdlib/recording.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use core::fmt::{Display, Formatter};
use cpal::traits::{DeviceTrait, HostTrait, StreamTrait};
use cpal::{BufferSize, StreamConfig};
use std::error::Error;
use std::time::Duration;
use std::time::{Duration, Instant};

#[derive(Debug)]
// #[derive(Debug, Clone)]
Expand Down Expand Up @@ -112,9 +112,13 @@ pub fn start_detector_thread(
Duration::from_secs_f32(data.len() as f32 / sampling_rate).as_millis()
);

let now = Instant::now();
let beat = detector.update_and_detect_beat(data.iter().copied());
let duration = now.elapsed();
log::trace!("Beat detection took {:?}", duration);

if let Some(beat) = beat {
log::debug!("Beat detection took {:?}", duration);
on_beat_cb(beat);
}
},
Expand Down

0 comments on commit ef0d9df

Please sign in to comment.