pub struct OpusEncoder { /* private fields */ }Expand description
CELT-only Opus encoder: 48 kHz interleaved f32 PCM in, complete Opus packets out. Frame sizes 120/240/480/960 samples per channel.
Implementations§
Source§impl OpusEncoder
impl OpusEncoder
pub fn new(channels: u32, bitrate: u32, vbr: bool) -> Result<Self, &'static str>
Sourcepub fn encode(&mut self, pcm: &[f32]) -> Result<Vec<u8>, &'static str>
pub fn encode(&mut self, pcm: &[f32]) -> Result<Vec<u8>, &'static str>
Encode one frame of interleaved f32 PCM (len = frame_size * channels, frame_size in {120, 240, 480, 960}). Returns the packet.
pub fn final_range(&self) -> u32
Trait Implementations§
Source§impl Drop for OpusEncoder
impl Drop for OpusEncoder
impl Send for OpusEncoder
Auto Trait Implementations§
impl !Sync for OpusEncoder
impl Freeze for OpusEncoder
impl RefUnwindSafe for OpusEncoder
impl Unpin for OpusEncoder
impl UnsafeUnpin for OpusEncoder
impl UnwindSafe for OpusEncoder
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