INNER CODE UNIT · Rust
from
RustAudio/cpal · src/lib.rs:880
fn from(conf: SupportedStreamConfig) -> Self {
conf.config()
}
}
#[allow(dead_code)]
pub(crate) fn validate_stream_config(config: &StreamConfig) -> Result<(), Error> {
if config.channels == 0 {
return Err(Error::with_message(
ErrorKind::InvalidInput,
"channel count must be at least 1",
));
}
if config.sample_rate == 0 {
return Err(Error::with_message(
ErrorKind::InvalidInput,
"sample rate must be at least 1 Hz",
));