pub enum DynamicEncoder {
Nb(SpeexEncoder<NbMode>),
Wb(SpeexEncoder<WbMode>),
Uwb(SpeexEncoder<UwbMode>),
}Expand description
An enumeration over the different encoder modes. For usecases where the encoder mode is not known at compile time.
Variants§
Implementations§
Source§impl DynamicEncoder
impl DynamicEncoder
Sourcepub fn get_frame_size(&mut self) -> i32
pub fn get_frame_size(&mut self) -> i32
Gets the frame size (in samples) of the encoder/decoder
Sourcepub fn set_vbr_quality(&mut self, quality: f32)
pub fn set_vbr_quality(&mut self, quality: f32)
Sets the VBR quality of the encoder/decoder
The value should be between 0 and 10, with 10 being the highest quality.
Sourcepub fn get_vbr_quality(&mut self) -> f32
pub fn get_vbr_quality(&mut self) -> f32
Gets the VBR quality of the encoder/decoder
Sourcepub fn set_quality(&mut self, quality: i32)
pub fn set_quality(&mut self, quality: i32)
Sets the overall quality of the encoder/decoder The value should be between 0 and 10, with 10 being the highest quality. Default is 8.
Sourcepub fn set_bitrate(&mut self, bitrate: i32)
pub fn set_bitrate(&mut self, bitrate: i32)
Sets the current bitrate of the encoder/decoder
Sourcepub fn get_bitrate(&mut self) -> i32
pub fn get_bitrate(&mut self) -> i32
Gets the current bitrate of the encoder/decoder
Sourcepub fn set_sampling_rate(&mut self, samplingrate: i32)
pub fn set_sampling_rate(&mut self, samplingrate: i32)
Sets the sampling rate used for bitrate computation
Sourcepub fn get_sampling_rate(&mut self) -> i32
pub fn get_sampling_rate(&mut self) -> i32
Gets the sampling rate used for bitrate computation
Sourcepub fn reset_state(&mut self)
pub fn reset_state(&mut self)
resets the encoder/decoder memories to zero
Sourcepub fn set_submode_encoding(&mut self, submode: bool)
pub fn set_submode_encoding(&mut self, submode: bool)
Sets whether submode encoding is done in each frame
Note that false breaks the specification for the format
Sourcepub fn get_submode_encoding(&mut self) -> bool
pub fn get_submode_encoding(&mut self) -> bool
Gets whether submode encoding is enabled or not
Sourcepub fn get_lookahead(&mut self) -> i32
pub fn get_lookahead(&mut self) -> i32
Gets the lookahead value currently in use by the encoder/decoder
Sum the lookahead of a Speex decoder and the lookahead of a Speex encoder to get the total lookahead.
Sourcepub fn set_plc_tuning(&mut self, tuning: i32)
pub fn set_plc_tuning(&mut self, tuning: i32)
Sets tuning for Packet-Loss Concealment (expected loss rate)
Sourcepub fn get_plc_tuning(&mut self) -> i32
pub fn get_plc_tuning(&mut self) -> i32
Gets current Packet-Loss Concealment tuning value
Sourcepub fn set_vbr_max_bitrate(&mut self, max_bitrate: i32)
pub fn set_vbr_max_bitrate(&mut self, max_bitrate: i32)
Sets the max bit-rate allowed in VBR mode
Sourcepub fn get_vbr_max_bitrate(&mut self) -> i32
pub fn get_vbr_max_bitrate(&mut self) -> i32
Gets the max bit-rate allowed in VBR mode
Sourcepub fn set_highpass(&mut self, highpass: bool)
pub fn set_highpass(&mut self, highpass: bool)
Enables or disables highpass filtering of the input/output
Sourcepub fn get_highpass(&mut self) -> bool
pub fn get_highpass(&mut self) -> bool
Gets whether highpass filtering of the input/output is enabled
Sourcepub fn set_complexity(&mut self, complexity: i32)
pub fn set_complexity(&mut self, complexity: i32)
Sets the analysis complexity of the encoder.
Sourcepub fn get_complexity(&mut self) -> i32
pub fn get_complexity(&mut self) -> i32
Gets the analysis complexity of the encoder.
Sourcepub fn encode(&mut self, input: &mut [f32], bits: &mut SpeexBits<'_>)
pub fn encode(&mut self, input: &mut [f32], bits: &mut SpeexBits<'_>)
Encode one frame of audio into the given bits.
Sourcepub fn encode_int(&mut self, input: &mut [i16], bits: &mut SpeexBits<'_>)
pub fn encode_int(&mut self, input: &mut [i16], bits: &mut SpeexBits<'_>)
Encode one frame of audio into the given bits, using an integer representation.