pub struct VorbisDecoder { /* private fields */ }Implementations§
Source§impl VorbisDecoder
impl VorbisDecoder
Sourcepub fn new(
extra_data: Option<&[u8]>,
sample_rate: u32,
channels: u8,
) -> Result<Self, AudioError>
pub fn new( extra_data: Option<&[u8]>, sample_rate: u32, channels: u8, ) -> Result<Self, AudioError>
Construct a decoder. extra_data MUST be the Xiph-laced
concatenation of the three Vorbis setup packets (ident +
comment + setup), as MKV CodecPrivate carries it. For OGG
sources, the demuxer is responsible for assembling the same
layout from the first three packets before calling here.
Trait Implementations§
Source§impl AudioDecoder for VorbisDecoder
impl AudioDecoder for VorbisDecoder
Source§fn decode(
&mut self,
packet: &[u8],
pts: i64,
) -> Result<Vec<AudioFrame>, AudioError>
fn decode( &mut self, packet: &[u8], pts: i64, ) -> Result<Vec<AudioFrame>, AudioError>
Decode one input packet at the given PTS (microseconds). May
return zero or more output frames (zero is normal — some
decoders need to see two frames before emitting one).
Source§fn flush(&mut self) -> Result<Vec<AudioFrame>, AudioError>
fn flush(&mut self) -> Result<Vec<AudioFrame>, AudioError>
Drain any frames buffered inside the decoder. Call once at EOS.
Auto Trait Implementations§
impl Freeze for VorbisDecoder
impl RefUnwindSafe for VorbisDecoder
impl Send for VorbisDecoder
impl Sync for VorbisDecoder
impl Unpin for VorbisDecoder
impl UnsafeUnpin for VorbisDecoder
impl UnwindSafe for VorbisDecoder
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