diff --git a/src/lib.rs b/src/lib.rs index e47f4566c..3a6a1e69a 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 }