Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions src/host/coreaudio/macos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,18 @@ impl Device {
let ranges: *mut AudioValueRange = ranges.as_mut_ptr() as *mut _;
let ranges: &'static [AudioValueRange] = slice::from_raw_parts(ranges, n_ranges);

let audio_unit = audio_unit_from_device(self, true)?;
#[allow(non_upper_case_globals)]
let input = match scope {
kAudioObjectPropertyScopeInput => Ok(true),
kAudioObjectPropertyScopeOutput => Ok(false),
_ => Err(BackendSpecificError {
description: format!(
"unexpected scope (neither input nor output): {:?}",
scope
),
}),
}?;
let audio_unit = audio_unit_from_device(self, input)?;
let buffer_size = get_io_buffer_frame_size_range(&audio_unit)?;

// Collect the supported formats for the device.
Expand Down Expand Up @@ -398,7 +409,18 @@ impl Device {
}
};

let audio_unit = audio_unit_from_device(self, true)?;
#[allow(non_upper_case_globals)]
let input = match scope {
kAudioObjectPropertyScopeInput => Ok(true),
kAudioObjectPropertyScopeOutput => Ok(false),
_ => Err(BackendSpecificError {
description: format!(
"unexpected scope (neither input nor output): {:?}",
scope
),
}),
}?;
let audio_unit = audio_unit_from_device(self, input)?;
let buffer_size = get_io_buffer_frame_size_range(&audio_unit)?;

let config = SupportedStreamConfig {
Expand Down
Loading