INNER CODE UNIT · Rust
sample_format
RustAudio/cpal · src/lib.rs:570
pub fn sample_format(&self) -> SampleFormat {
self.sample_format
}
pub fn config(&self) -> StreamConfig {
StreamConfig {
channels: self.channels,
sample_rate: self.sample_rate,
buffer_size: BufferSize::Default,
}
}
}
// Note: Data does not implement `is_empty()` because it always contains a valid audio buffer
// by design. The buffer may contain silence, but it is never structurally empty.
#[expect(clippy::len_without_is_empty)]
impl Data {
/// Constructor for host implementations to use.