Trait sampler::map::Audio [] [src]

pub trait Audio: Clone {
    type Frame: Frame;
    fn data(&self) -> &[Self::Frame];
}

The audio data that provides the slice of frames that are to be rendered.

By making this a trait instead of a hard type, we can allow users to use their own Audio types which might require other data (i.e. file paths, names, etc) for unique serialization implementations.

Associated Types

type Frame: Frame

The type of Frame data associated with the audio.

Required Methods

fn data(&self) -> &[Self::Frame]

A reference to the slice of frames used to play the audio.

Implementors