[−][src]Struct magnum_opus::Encoder
An Opus encoder with associated state.
Implementations
impl Encoder
[src]
pub fn new(
sample_rate: u32,
channels: Channels,
mode: Application
) -> Result<Encoder>
[src]
sample_rate: u32,
channels: Channels,
mode: Application
) -> Result<Encoder>
Create and initialize an encoder.
pub fn encode(&mut self, input: &[i16], output: &mut [u8]) -> Result<usize>
[src]
Encode an Opus frame.
pub fn encode_float(
&mut self,
input: &[f32],
output: &mut [u8]
) -> Result<usize>
[src]
&mut self,
input: &[f32],
output: &mut [u8]
) -> Result<usize>
Encode an Opus frame from floating point input.
pub fn encode_vec(&mut self, input: &[i16], max_size: usize) -> Result<Vec<u8>>
[src]
Encode an Opus frame to a new buffer.
pub fn encode_vec_float(
&mut self,
input: &[f32],
max_size: usize
) -> Result<Vec<u8>>
[src]
&mut self,
input: &[f32],
max_size: usize
) -> Result<Vec<u8>>
Encode an Opus frame from floating point input to a new buffer.
pub fn reset_state(&mut self) -> Result<()>
[src]
Reset the codec state to be equivalent to a freshly initialized state.
pub fn get_final_range(&mut self) -> Result<u32>
[src]
Get the final range of the codec's entropy coder.
pub fn get_bandwidth(&mut self) -> Result<Bandwidth>
[src]
Get the encoder's configured bandpass.
pub fn get_sample_rate(&mut self) -> Result<u32>
[src]
Get the samping rate the encoder was intialized with.
pub fn set_bitrate(&mut self, value: Bitrate) -> Result<()>
[src]
Set the encoder's bitrate.
pub fn get_bitrate(&mut self) -> Result<Bitrate>
[src]
Get the encoder's bitrate.
pub fn set_vbr(&mut self, vbr: bool) -> Result<()>
[src]
Enable or disable variable bitrate.
pub fn get_vbr(&mut self) -> Result<bool>
[src]
Determine if variable bitrate is enabled.
pub fn set_vbr_constraint(&mut self, vbr: bool) -> Result<()>
[src]
Enable or disable constrained VBR.
pub fn get_vbr_constraint(&mut self) -> Result<bool>
[src]
Determine if constrained VBR is enabled.
pub fn set_inband_fec(&mut self, value: bool) -> Result<()>
[src]
Configures the encoder's use of inband forward error correction (FEC).
pub fn get_inband_fec(&mut self) -> Result<bool>
[src]
Gets encoder's configured use of inband forward error correction.
pub fn set_packet_loss_perc(&mut self, value: i32) -> Result<()>
[src]
Sets the encoder's expected packet loss percentage.
pub fn get_packet_loss_perc(&mut self) -> Result<i32>
[src]
Gets the encoder's expected packet loss percentage.
pub fn get_lookahead(&mut self) -> Result<i32>
[src]
Gets the total samples of delay added by the entire codec.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Encoder
impl !Sync for Encoder
impl Unpin for Encoder
impl UnwindSafe for Encoder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,