pub struct OpusMSEncoder {
pub bitrate_bps: i32,
/* private fields */
}Expand description
Multistream encoder: one Opus encoder per stream (coupled = stereo, the rest mono), coded per the channel layout and concatenated self-delimited.
Fields§
§bitrate_bps: i32Total target bitrate across all streams (split evenly, coupled=2x mono).
Implementations§
Source§impl OpusMSEncoder
impl OpusMSEncoder
pub fn new( sample_rate: i32, channels: usize, mapping_family: i32, application: Application, ) -> Result<Self, &'static str>
Sourcepub fn set_bitrate(&mut self, total: i32)
pub fn set_bitrate(&mut self, total: i32)
Split the total bitrate across streams (each coupled stream gets 2x a mono stream’s share, matching its 2 channels).
pub fn nb_streams(&self) -> usize
Sourcepub fn encode(
&mut self,
input: &[f32],
frame_size: usize,
) -> Result<Vec<u8>, &'static str>
pub fn encode( &mut self, input: &[f32], frame_size: usize, ) -> Result<Vec<u8>, &'static str>
Encode one frame of interleaved input (nb_channels per sample) into a
multistream packet. scratch output is returned as a Vec.
pub fn sample_rate(&self) -> i32
Source§impl OpusMSEncoder
Bandwidth passthrough helper (so callers can cap all streams at once).
impl OpusMSEncoder
Bandwidth passthrough helper (so callers can cap all streams at once).
pub fn set_max_bandwidth(&mut self, bw: Bandwidth)
Auto Trait Implementations§
impl Freeze for OpusMSEncoder
impl RefUnwindSafe for OpusMSEncoder
impl Send for OpusMSEncoder
impl Sync for OpusMSEncoder
impl Unpin for OpusMSEncoder
impl UnsafeUnpin for OpusMSEncoder
impl UnwindSafe for OpusMSEncoder
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