Struct WaveReader

Source
pub struct WaveReader<T>
where T: Read + Seek,
{ pub pcm_format: PcmFormat, /* private fields */ }
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§

Source§

impl<T> WaveReader<T>
where T: Read + Seek,

Source

pub fn new(reader: T) -> ReadResult<WaveReader<T>>

Returns a new wave reader for the given reader.

Source

pub fn read_sample_u8(&mut self) -> Result<u8>

Reads a single sample as an unsigned 8-bit value.

Source

pub fn read_sample_i16(&mut self) -> Result<i16>

Reads a single sample as a signed 16-bit value.

Source

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.

Source

pub fn read_sample_i32(&mut self) -> Result<i32>

Reads a single sample as a signed 32-bit value.

Source

pub fn into_inner(self) -> T

Consumes this reader, returning the underlying value.

Auto Trait Implementations§

§

impl<T> Freeze for WaveReader<T>
where T: Freeze,

§

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.