Fix: MIDI precision

This commit is contained in:
2026-03-18 02:16:05 +01:00
parent faf541e536
commit 30dfe7372d
24 changed files with 198 additions and 272 deletions

View File

@@ -282,6 +282,7 @@ pub struct AudioStreamInfo {
pub sample_rate: f32,
pub host_name: String,
pub channels: u16,
pub input_sample_rate: Option<f32>,
}
#[cfg(feature = "cli")]
@@ -367,10 +368,16 @@ pub fn build_stream(
dev
});
let input_channels: usize = input_device
let input_config = input_device
.as_ref()
.and_then(|dev| dev.default_input_config().ok());
let input_channels: usize = input_config
.as_ref()
.and_then(|dev| dev.default_input_config().ok())
.map_or(0, |cfg| cfg.channels() as usize);
let input_sample_rate = input_config.and_then(|cfg| {
let rate = cfg.sample_rate() as f32;
(rate != sample_rate).then_some(rate)
});
engine.input_channels = input_channels;
@@ -519,6 +526,7 @@ pub fn build_stream(
sample_rate,
host_name,
channels: effective_channels,
input_sample_rate,
};
Ok((stream, input_stream, info, analysis_handle, registry))
}