[−][src]Struct creak::Decoder
An audio decoder.
Use Decoder::open
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.
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]
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<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,