Skip to content

Commit

Permalink
changed the way to collect supported samplerate range
Browse files Browse the repository at this point in the history
  • Loading branch information
tomoyanonymous committed Nov 12, 2024
1 parent 582e93c commit a5b8ca3
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/host/coreaudio/macos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,19 +300,15 @@ impl Device {
let buffer_size = get_io_buffer_frame_size_range(&audio_unit)?;

// Collect the supported formats for the device.
let mut fmts = vec![];
for range in ranges {
let fmt = SupportedStreamConfigRange {
channels: n_channels as ChannelCount,
min_sample_rate: SampleRate(range.mMinimum as _),
max_sample_rate: SampleRate(range.mMaximum as _),
min_sample_rate: SampleRate(ranges.iter().map(|v| v.mMinimum as u32).min().unwrap()),
max_sample_rate: SampleRate(ranges.iter().map(|v| v.mMaximum as u32).max().unwrap()),
buffer_size,
sample_format,
};
fmts.push(fmt);
}

Ok(fmts.into_iter())
Ok(vec![fmt].into_iter())
}
}

Expand Down

0 comments on commit a5b8ca3

Please sign in to comment.