Struct riff_wave::WaveReader
source · [−]Expand description
Helper struct that takes ownership of a reader and can be used to read data from a PCM wave file.
Fields
pcm_format: PcmFormat
Represents the PCM format for this wave file.
Implementations
sourceimpl<T> WaveReader<T> where
T: Read + Seek,
impl<T> WaveReader<T> where
T: Read + Seek,
sourcepub fn new(reader: T) -> ReadResult<WaveReader<T>>
pub fn new(reader: T) -> ReadResult<WaveReader<T>>
Returns a new wave reader for the given reader.
sourcepub fn read_sample_u8(&mut self) -> Result<u8>
pub fn read_sample_u8(&mut self) -> Result<u8>
Reads a single sample as an unsigned 8-bit value.
sourcepub fn read_sample_i16(&mut self) -> Result<i16>
pub fn read_sample_i16(&mut self) -> Result<i16>
Reads a single sample as a signed 16-bit value.
sourcepub fn read_sample_i24(&mut self) -> Result<i32>
pub fn read_sample_i24(&mut self) -> Result<i32>
Reads a single sample as a signed 24-bit value. The value will be padded to fit in a 32-bit buffer.
sourcepub fn read_sample_i32(&mut self) -> Result<i32>
pub fn read_sample_i32(&mut self) -> Result<i32>
Reads a single sample as a signed 32-bit value.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes this reader, returning the underlying value.
Auto Trait Implementations
impl<T> RefUnwindSafe for WaveReader<T> where
T: RefUnwindSafe,
impl<T> Send for WaveReader<T> where
T: Send,
impl<T> Sync for WaveReader<T> where
T: Sync,
impl<T> Unpin for WaveReader<T> where
T: Unpin,
impl<T> UnwindSafe for WaveReader<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more