Skip to content

Commit

Permalink
Also export constructor for SupportedStreamConfig
Browse files Browse the repository at this point in the history
This is related to #535.
  • Loading branch information
yamadapc authored and est31 committed Jul 6, 2022
1 parent 411c671 commit 493a090
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 493a090

Please sign in to comment.