pub struct OpusEncoder {
pub bitrate_bps: i32,
pub complexity: i32,
pub use_cbr: bool,
pub use_inband_fec: bool,
pub use_dtx: bool,
pub packet_loss_perc: i32,
pub force_bandwidth: Option<Bandwidth>,
pub signal_type: Option<SignalType>,
pub max_bandwidth: Bandwidth,
pub lsb_depth: i32,
/* private fields */
}Fields§
§bitrate_bps: i32§complexity: i32§use_cbr: bool§use_inband_fec: bool§use_dtx: boolDiscontinuous transmission: after enough consecutive inactive frames, emit a 1-byte (TOC-only) packet so the decoder runs comfort-noise/PLC.
packet_loss_perc: i32§force_bandwidth: Option<Bandwidth>Overrides automatic bandwidth selection when set (OPUS_SET_BANDWIDTH).
signal_type: Option<SignalType>OPUS_SET_SIGNAL: force the voice/music bias (None = auto from analysis).
max_bandwidth: BandwidthOPUS_SET_MAX_BANDWIDTH: cap the automatically-selected bandwidth.
lsb_depth: i32Input bit depth assumed by the analysis noise floors. The float API default is 24; set 16 for s16-sourced content (opus_demo parity).
Implementations§
Source§impl OpusEncoder
impl OpusEncoder
pub fn new( sampling_rate: i32, channels: usize, application: Application, ) -> Result<Self, &'static str>
pub fn enable_hybrid_mode(&mut self) -> Result<(), &'static str>
Sourcepub fn final_range(&self) -> u32
pub fn final_range(&self) -> u32
Final range-coder state of the last encoded packet (libopus
OPUS_GET_FINAL_RANGE). Stored in opus_demo .bit framing so the reference
decoder can verify encoder/decoder range-coder agreement per packet.
pub fn encode( &mut self, input: &[f32], frame_size: usize, output: &mut [u8], ) -> Result<usize, &'static str>
Auto Trait Implementations§
impl Freeze for OpusEncoder
impl RefUnwindSafe for OpusEncoder
impl Send for OpusEncoder
impl Sync 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