Struct PcmXLawDecoderWrap

Source
pub struct PcmXLawDecoderWrap { /* private fields */ }
Expand description
  • The PcmXLawDecoderWrap to decode aLaw or MuLaw PCM data to your specific format samples

Implementations§

Source§

impl PcmXLawDecoderWrap

Source

pub fn new( reader: Box<dyn Reader>, which_law: XLaw, data_offset: u64, data_length: u64, fmt: &FmtChunk, total_samples: u64, ) -> Result<Self, AudioReadError>

Source

pub fn get_cur_frame_index(&self) -> u64

Source

pub fn seek(&mut self, from: SeekFrom) -> Result<(), AudioReadError>

Source

pub fn decode_mono<S>(&mut self) -> Result<Option<S>, AudioReadError>
where S: SampleType,

Source

pub fn decode_stereo<S>(&mut self) -> Result<Option<(S, S)>, AudioReadError>
where S: SampleType,

Source

pub fn decode_frame<S>(&mut self) -> Result<Option<Vec<S>>, AudioReadError>
where S: SampleType,

Trait Implementations§

Source§

impl Debug for PcmXLawDecoderWrap

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S> Decoder<S> for PcmXLawDecoderWrap
where S: SampleType,

Source§

fn get_channels(&self) -> u16

Get num channels
Source§

fn get_cur_frame_index(&mut self) -> Result<u64, AudioReadError>

Get current frame index.
Source§

fn seek(&mut self, seek_from: SeekFrom) -> Result<(), AudioReadError>

Seek to a specific audio frame. An audio frame is each channel has one sample.
Source§

fn decode_frame(&mut self) -> Result<Option<Vec<S>>, AudioReadError>

Decode one audio frame. An audio frame is each channel has one sample. This method supports > 2 channels.
Source§

fn decode_stereo(&mut self) -> Result<Option<(S, S)>, AudioReadError>

Decode a stereo sample with left and right samples, if the audio has > 2 channels, this method fails.
Source§

fn decode_mono(&mut self) -> Result<Option<S>, AudioReadError>

Decode a mono sample, multiple channels will be mixed into one channel.
Source§

fn decode_frames( &mut self, num_frames: usize, ) -> Result<Vec<Vec<S>>, AudioReadError>

Decode multiple audio frames. This method supports > 2 channels.
Source§

fn decode_monos(&mut self, num_monos: usize) -> Result<Vec<S>, AudioReadError>

Decode multiple mono samples, multiple channels will be mixed into one channel.
Source§

fn decode_stereos( &mut self, num_stereos: usize, ) -> Result<Vec<(S, S)>, AudioReadError>

Decode multiple stereo samples with left and right samples, if the audio has > 2 channels, this method fails.
Source§

fn set_downmixer(&mut self, _downmixer: &Downmixer)

Set the downmixer
Source§

fn get_downmixer(&self) -> Option<Downmixer>

Get the downmixer

Auto Trait Implementations§

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.