This post was published 118 days ago . The information described in this article may have changed.
This post is auto-generated from RSS feed
The Rust Programming Language Forum - Latest topics . Source:
Need help organizing multithreaded audio code - involving sync <-> async
Hi,
while working on my room impulse response measurement software raumklang I came up with this code for recording new measurements:
MeasurementState::PreparingMeasurement { .. } => {}
MeasurementState::MeasurementRunning { .. } => {}
}
}
}
pub fn recording_button<'a, Message: 'a>(msg: Message) -> Button<'a, Message> {
button(colored_circle(8.0, Color::from_rgb8(200, 56, 42))).on_press(msg)
}
mod audio_backend {
use std::sync::atomic::AtomicBool;
use std::sync::mpsc::RecvTimeoutError;
use std::sync::Arc;
use std::time::{Duration, Instant};
use iced::futures::{SinkExt, Stream};
use iced::stream;
use jack::PortFlags;
use raumklang_core::{dbfs, LoudnessMeter};
Unfortunately, with all the things like async
, jacks real-time audio thread
and the non-realtime notification thread
together, I find it really hard to organize my code. I would really appreciate any help on this.
The basic workflow is:
connect to jack audio server
user chooses input and output ports
calibrate volume with pink-noise
playback sine-sweep and record the measurement
Let me know if you need further information.
1 post - 1 participant
Read full topic
🏷️ rust_feed