[][src]Enum audrey::read::Reader

pub enum Reader<R> where
    R: Read + Seek
{ Flac(FlacReader<R>), OggVorbis(OggStreamReader<R>), Wav(WavReader<R>), CafAlac(AlacReader<R>), }

Returned by the read function, enumerates the various supported readers.

Variants

Flac(FlacReader<R>)
OggVorbis(OggStreamReader<R>)
Wav(WavReader<R>)
CafAlac(AlacReader<R>)

Implementations

impl Reader<BufReader<File>>[src]

pub fn open<P>(file_path: P) -> Result<Self, ReadError> where
    P: AsRef<Path>, 
[src]

Attempts to open an audio Reader from the file at the specified Path.

This function is a convenience wrapper around the Reader::new function.

This function pays no attention to the file_path's extension and instead attempts to read a supported Format via the file header.

impl<R> Reader<R> where
    R: Read + Seek
[src]

pub fn new(mut reader: R) -> Result<Self, ReadError>[src]

Attempts to read the format of the audio read by the given reader and returns the associated Reader variant.

The format is determined by attempting to construct each specific format reader until one is successful.

pub fn format(&self) -> Format[src]

The format from which the audio will be read.

pub fn description(&self) -> Description[src]

A basic description of the audio being read.

pub fn samples<S>(&mut self) -> Samples<'_, R, S>

Notable traits for Samples<'a, R, S>

impl<'a, R, S> Iterator for Samples<'a, R, S> where
    R: Read + Seek,
    S: Sample
type Item = Result<S, FormatError>;
where
    S: Sample
[src]

Produce an iterator that reads samples from the underlying reader, converts them to the sample type S if not already in that format and yields them.

When reading from multiple channels, samples are interleaved.

pub fn frames<F>(&mut self) -> Frames<'_, R, F>

Notable traits for Frames<'a, R, F>

impl<'a, R, F> Iterator for Frames<'a, R, F> where
    R: Read + Seek,
    F: Frame,
    F::Sample: Sample
type Item = Result<F, FormatError>;
where
    F: Frame,
    F::Sample: Sample
[src]

Produce an iterator that yields read frames from the underlying Reader.

This method currently expects that the frame type F has the same number of channels as stored in the underlying audio format.

TODO: Should consider changing this behaviour to check the audio file's actual number of channels and automatically convert to F's number of channels while reading.

Auto Trait Implementations

impl<R> RefUnwindSafe for Reader<R> where
    R: RefUnwindSafe
[src]

impl<R> Send for Reader<R> where
    R: Send
[src]

impl<R> Sync for Reader<R> where
    R: Sync
[src]

impl<R> Unpin for Reader<R> where
    R: Unpin
[src]

impl<R> UnwindSafe for Reader<R> where
    R: UnwindSafe
[src]

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<S, T> Duplex<S> for T where
    T: FromSample<S> + ToSample<S>, 
[src]

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

impl<S> FromSample<S> for S[src]

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

impl<T, U> ToSample<U> for T where
    U: FromSample<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.