pub trait SampleResourceInfo {
// Required methods
fn num_channels(&self) -> NonZeroUsize;
fn len_frames(&self) -> u64;
// Provided method
fn sample_rate(&self) -> Option<NonZeroU32> { ... }
}Expand description
Trait returning information about a resource of audio samples
Required Methods§
Sourcefn num_channels(&self) -> NonZeroUsize
fn num_channels(&self) -> NonZeroUsize
The number of channels in this resource.
Sourcefn len_frames(&self) -> u64
fn len_frames(&self) -> u64
The length of this resource in samples (of a single channel of audio).
Not to be confused with video frames.
Provided Methods§
Sourcefn sample_rate(&self) -> Option<NonZeroU32>
fn sample_rate(&self) -> Option<NonZeroU32>
The sample rate of this resource.
Returns None if the sample rate is unknown.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".