Struct riff_wave::WaveReader
[−]
[src]
pub struct WaveReader<T> where T: Read + Seek { pub pcm_format: PcmFormat, // some fields omitted }
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.
Methods
impl<T> WaveReader<T> where T: Read + Seek
[src]
fn new(reader: T) -> ReadResult<WaveReader<T>>
Returns a new wave reader for the given reader.
fn read_sample_u8(&mut self) -> Result<u8>
Reads a single sample as an unsigned 8-bit value.
fn read_sample_i16(&mut self) -> Result<i16>
Reads a single sample as a signed 16-bit value.
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.
fn read_sample_i32(&mut self) -> Result<i32>
Reads a single sample as a signed 32-bit value.
fn read_samples_as_u8(&mut self, buf: &mut [u8]) -> Result<usize>
Reads several samples as unsigned 8-bit values. Returns the number of samples read, or an io error if one occurred before data was read.
fn read_samples_as_i16(&mut self, buf: &mut [i16]) -> Result<usize>
Reads several samples as signed 16-bit values. Returns the number of samples read, or an io error if one occurred before data was read.
fn read_samples_as_i24(&mut self, buf: &mut [i32]) -> Result<usize>
Reads several samples as signed 24-bit values. The values will be padded to fit in a 32-bit buffer. Returns the number of samples read, or an io error if one occurred before data was read.
fn read_samples_as_i32(&mut self, buf: &mut [i32]) -> Result<usize>
Reads several samples as signed 32-bit values. Returns the number of samples read, or an io error if one occurred before data was read.