pub struct OggVorbisDecoderWrap {
pub downmixer: Downmixer,
/* private fields */
}
Expand description
- The OggVorbis decoder for
WaveReader
Fields§
§downmixer: Downmixer
The downmixer for multiple channels audio to decode into 2 or 1 channels
Implementations§
Source§impl OggVorbisDecoderWrap
impl OggVorbisDecoderWrap
pub fn new( reader: Box<dyn Reader>, data_offset: u64, data_length: u64, fmt: &FmtChunk, total_samples: u64, downmixer: Option<Downmixer>, ) -> Result<Self, AudioReadError>
Sourcepub fn get_channels(&self) -> u16
pub fn get_channels(&self) -> u16
Get how many channels in the OggVorbis audio data
Sourcepub fn get_cur_frame_index(&self) -> u64
pub fn get_cur_frame_index(&self) -> u64
Get the current decoding audio frame index. The audio frame is an array for all channels’ one sample.
Sourcepub fn seek(&mut self, seek_from: SeekFrom) -> Result<(), AudioReadError>
pub fn seek(&mut self, seek_from: SeekFrom) -> Result<(), AudioReadError>
Seek to the block that contains the specific frame index of the audio frame.
Sourcepub fn decode_frame<S>(&mut self) -> Result<Option<Vec<S>>, AudioReadError>where
S: SampleType,
pub fn decode_frame<S>(&mut self) -> Result<Option<Vec<S>>, AudioReadError>where
S: SampleType,
Decode as audio frames. The audio frame is an array for all channels’ one sample.
Sourcepub fn decode_stereo<S>(&mut self) -> Result<Option<(S, S)>, AudioReadError>where
S: SampleType,
pub fn decode_stereo<S>(&mut self) -> Result<Option<(S, S)>, AudioReadError>where
S: SampleType,
Decode as stereo audio
Sourcepub fn decode_mono<S>(&mut self) -> Result<Option<S>, AudioReadError>where
S: SampleType,
pub fn decode_mono<S>(&mut self) -> Result<Option<S>, AudioReadError>where
S: SampleType,
Decode as mono audio. All channel samples will be mixed into one.
Trait Implementations§
Source§impl Debug for OggVorbisDecoderWrap
impl Debug for OggVorbisDecoderWrap
Source§impl<S> Decoder<S> for OggVorbisDecoderWrapwhere
S: SampleType,
impl<S> Decoder<S> for OggVorbisDecoderWrapwhere
S: SampleType,
Source§fn get_channels(&self) -> u16
fn get_channels(&self) -> u16
Get num channels
Source§fn get_cur_frame_index(&mut self) -> Result<u64, AudioReadError>
fn get_cur_frame_index(&mut self) -> Result<u64, AudioReadError>
Get current frame index.
Source§fn seek(&mut self, seek_from: SeekFrom) -> Result<(), AudioReadError>
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>
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>
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>
fn decode_mono(&mut self) -> Result<Option<S>, AudioReadError>
Decode a mono sample, multiple channels will be mixed into one channel.
Source§fn set_downmixer(&mut self, downmixer: &Downmixer)
fn set_downmixer(&mut self, downmixer: &Downmixer)
Set the downmixer
Source§fn get_downmixer(&self) -> Option<Downmixer>
fn get_downmixer(&self) -> Option<Downmixer>
Get the downmixer
Source§fn decode_frames(
&mut self,
num_frames: usize,
) -> Result<Vec<Vec<S>>, AudioReadError>
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>
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>
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.
Auto Trait Implementations§
impl Freeze for OggVorbisDecoderWrap
impl !RefUnwindSafe for OggVorbisDecoderWrap
impl !Send for OggVorbisDecoderWrap
impl !Sync for OggVorbisDecoderWrap
impl Unpin for OggVorbisDecoderWrap
impl !UnwindSafe for OggVorbisDecoderWrap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more