pub struct OpusDecoder { /* private fields */ }Implementations§
Source§impl OpusDecoder
impl OpusDecoder
Sourcepub fn new_default() -> Self
pub fn new_default() -> Self
Create a default Opus decoder (48kHz, stereo)
Sourcepub fn decode_into_raw(&mut self, data: &[u8], output: &mut [i16]) -> usize
pub fn decode_into_raw(&mut self, data: &[u8], output: &mut [i16]) -> usize
Lower-level decode that does not perform the stereo→mono downmix.
Used internally by both the trait impl and the back-comat decode.
Trait Implementations§
Source§impl Decoder for OpusDecoder
impl Decoder for OpusDecoder
Source§fn decode(&mut self, data: &[u8]) -> PcmBuf
fn decode(&mut self, data: &[u8]) -> PcmBuf
Override the default to preserve back-comat stereo→mono downmix
when the decoder was configured with channels == 2.
Source§fn decode_into(
&mut self,
data: &[u8],
out: &mut [Sample],
) -> Result<usize, CodecError>
fn decode_into( &mut self, data: &[u8], out: &mut [Sample], ) -> Result<usize, CodecError>
Source§fn max_decode_samples(&self, n_bytes: usize) -> usize
fn max_decode_samples(&self, n_bytes: usize) -> usize
Upper bound on the number of samples that
decode_into will write
for an input of n_bytes bytes.Source§fn sample_rate(&self) -> u32
fn sample_rate(&self) -> u32
Get the sample rate of the decoded audio.
Auto Trait Implementations§
impl Freeze for OpusDecoder
impl RefUnwindSafe for OpusDecoder
impl Send for OpusDecoder
impl Sync for OpusDecoder
impl Unpin for OpusDecoder
impl UnsafeUnpin for OpusDecoder
impl UnwindSafe for OpusDecoder
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