Struct opus::Encoder
[−]
[src]
pub struct Encoder { /* fields omitted */ }
An Opus encoder with associated state.
Methods
impl Encoder
[src]
fn new(sample_rate: u32, channels: Channels, mode: Application) -> Result<Encoder>
Create and initialize an encoder.
fn encode(&mut self, input: &[i16], output: &mut [u8]) -> Result<usize>
Encode an Opus frame.
fn encode_float(&mut self, input: &[f32], output: &mut [u8]) -> Result<usize>
Encode an Opus frame from floating point input.
fn encode_vec(&mut self, input: &[i16], max_size: usize) -> Result<Vec<u8>>
Encode an Opus frame to a new buffer.
fn encode_vec_float(&mut self, input: &[f32], max_size: usize) -> Result<Vec<u8>>
Encode an Opus frame from floating point input to a new buffer.
fn reset_state(&mut self) -> Result<()>
Reset the codec state to be equivalent to a freshly initialized state.
fn get_final_range(&mut self) -> Result<u32>
Get the final range of the codec's entropy coder.
fn get_bandwidth(&mut self) -> Result<Bandwidth>
Get the encoder's configured bandpass.
fn get_sample_rate(&mut self) -> Result<u32>
Get the samping rate the encoder was intialized with.
fn set_bitrate(&mut self, value: Bitrate) -> Result<()>
Set the encoder's bitrate.
fn get_bitrate(&mut self) -> Result<Bitrate>
Get the encoder's bitrate.
fn set_inband_fec(&mut self, value: bool) -> Result<()>
Configures the encoder's use of inband forward error correction (FEC).
fn get_inband_fec(&mut self) -> Result<bool>
Gets encoder's configured use of inband forward error correction.
fn set_packet_loss_perc(&mut self, value: i32) -> Result<()>
Sets the encoder's expected packet loss percentage.
fn get_packet_loss_perc(&mut self) -> Result<i32>
Gets the encoder's expected packet loss percentage.
fn get_lookahead(&mut self) -> Result<i32>
Gets the total samples of delay added by the entire codec.