INNER CODE UNIT · Rust
with_standard_sample_rate
RustAudio/cpal · src/lib.rs:785
pub fn with_standard_sample_rate(self) -> SupportedStreamConfig {
self.try_with_standard_sample_rate()
.expect("no standard sample rate (48000 or 44100 Hz) in supported range")
}
/// A comparison function which compares two [`SupportedStreamConfigRange`]s in terms of their
/// priority of use as a default stream format.
///
/// Some backends do not provide a default stream format for their audio devices. In these
/// cases, CPAL attempts to decide on a reasonable default format for the user. To do this we
/// use the "greatest" of all supported stream formats when compared with this method.
///
/// [`SupportedStreamConfig`]s are prioritised by the following heuristics, applied in order:
///
/// **Channels**:
///
/// 1. Stereo
/// 2. Mono