INNER CODE UNIT · Rust
i_tx
Rikorose/DeepFilterNet · ladspa/src/lib.rs:211
let i_tx = Arc::new(Mutex::new(vec![VecDeque::with_capacity(hop * 4); channels]));
let o_rx = Arc::new(Mutex::new(vec![VecDeque::with_capacity(hop * 4); channels]));
let frame_size = hop;
let proc_delay = hop;
// Add a buffer of 1 frame to compensate processing delays causing underruns
for o_ch in o_rx.lock().unwrap().iter_mut() {
for _ in 0..proc_delay {
o_ch.push_back(0f32)
}
}
let sleep_duration = Duration::from_secs_f32(hop as f32 / m_sr as f32 / 5.);
let id = Uuid::new_v4().as_urn().to_string().split_at(33).1.to_string();
let (control_tx, control_rx) = sync_channel(32);
let worker_handle = thread::spawn(get_worker_fn(
Arc::clone(&i_tx),
Arc::clone(&o_rx),