From 493a0904f3fbd3486f11a089601a14e79abd1d36 Mon Sep 17 00:00:00 2001 From: yamadapc Date: Wed, 6 Jul 2022 19:19:17 +1000 Subject: [PATCH] Also export constructor for SupportedStreamConfig This is related to #535. --- src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index e47f456..3a6a1e6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -331,6 +331,20 @@ pub struct OutputCallbackInfo { } impl SupportedStreamConfig { + pub fn new( + channels: ChannelCount, + sample_rate: SampleRate, + buffer_size: SupportedBufferSize, + sample_format: SampleFormat, + ) -> Self { + Self { + channels, + sample_rate, + buffer_size, + sample_format, + } + } + pub fn channels(&self) -> ChannelCount { self.channels }