Skip to content

Commit

Permalink
change latency
Browse files Browse the repository at this point in the history
  • Loading branch information
vyalovvldmr committed Jan 5, 2025
1 parent def6162 commit 2051d8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use ringbuf::{
use tracing::{debug, error, info, level_filters::LevelFilter};
use tracing_subscriber::EnvFilter;

const LATENCY: std::time::Duration = std::time::Duration::from_millis(6);
const LATENCY: std::time::Duration = std::time::Duration::from_millis(11);

#[derive(Parser, Debug)]
#[command(version, about = "sidetone", long_about = None)]
Expand Down Expand Up @@ -80,7 +80,7 @@ fn main() -> anyhow::Result<()> {
debug!("input device config {:#?}", &config);
let latency_frames = (LATENCY.as_millis() as f32 / 1_000.0) * config.sample_rate.0 as f32;
let latency_samples = latency_frames as usize * config.channels as usize;
let ring = HeapRb::<f32>::new(latency_samples * 2);
let ring = HeapRb::<f32>::new(latency_samples);
let (mut producer, mut consumer) = ring.split();

for _ in 0..latency_samples {
Expand Down

0 comments on commit 2051d8b

Please sign in to comment.