Skip to main content

SampleResourceInfo

Trait SampleResourceInfo 

Source
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§

Source

fn num_channels(&self) -> NonZeroUsize

The number of channels in this resource.

Source

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§

Source

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".

Implementations on Foreign Types§

Source§

impl SampleResourceInfo for Vec<Vec<f32>>

Implementors§