[−][src]Enum audrey::read::Reader
Returned by the read
function, enumerates the various supported readers.
Variants
Flac(FlacReader<R>)
OggVorbis(OggStreamReader<R>)
Wav(WavReader<R>)
Implementations
impl Reader<BufReader<File>>
[src]
pub fn open<P>(file_path: P) -> Result<Self, ReadError> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
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]
R: Read + Seek,
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>ⓘ where
S: Sample,
[src]
S: Sample,
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>ⓘ where
F: Frame,
F::Sample: Sample,
[src]
F: Frame,
F::Sample: Sample,
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]
R: RefUnwindSafe,
impl<R> Send for Reader<R> where
R: Send,
[src]
R: Send,
impl<R> Sync for Reader<R> where
R: Sync,
[src]
R: Sync,
impl<R> Unpin for Reader<R> where
R: Unpin,
[src]
R: Unpin,
impl<R> UnwindSafe for Reader<R> where
R: UnwindSafe,
[src]
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<S, T> Duplex<S> for T where
T: FromSample<S> + ToSample<S>,
[src]
T: FromSample<S> + ToSample<S>,
impl<T> From<T> for T
[src]
impl<S> FromSample<S> for S
[src]
pub fn from_sample_(s: S) -> S
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> ToSample<U> for T where
U: FromSample<T>,
[src]
U: FromSample<T>,
pub fn to_sample_(self) -> U
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,