Skip to main content

SampleResourceInfo

Trait SampleResourceInfo 

Source
pub trait SampleResourceInfo:
    Send
    + Sync
    + 'static {
    // 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.

Implementations on Foreign Types§

Source§

impl SampleResourceInfo for Vec<Vec<f32>>

Source§

impl SampleResourceInfo for Vec<Vec<i16>>

Source§

impl SampleResourceInfo for Vec<Vec<u16>>

Implementors§