[][src]Struct creak::Decoder

pub struct Decoder { /* fields omitted */ }

An audio decoder.

Use Decoder::open or Decoder::open_raw to open an audio file and read samples.

Implementations

impl Decoder[src]

pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, DecoderError>[src]

Attempts to open the specified audio file for decoding.

Creak uses the file's extension to determine what kind of format it is. The currently recognized extensions are:

  • .wav - WAV.
  • .ogg - Ogg Vorbis.
  • .mp3 - MP3.
  • .flac - FLAC.

pub fn open_raw<P: AsRef<Path>>(
    path: P,
    spec: RawAudioSpec
) -> Result<Self, DecoderError>
[src]

Attempts to open the specified audio file for raw sample decoding.

The format of the source samples is determined from the RawAudioSpec passed to the function.

impl Decoder[src]

pub fn info(&self) -> AudioInfo[src]

Gets information about the audio, such as channel count and sample rate.

pub fn into_samples(self) -> Result<SampleIterator, DecoderError>[src]

Consumes the Decoder and returns an iterator over the samples. Channels are interleaved.

Auto Trait Implementations

impl RefUnwindSafe for Decoder

impl Send for Decoder

impl Sync for Decoder

impl Unpin for Decoder

impl UnwindSafe for Decoder

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.