pub enum DynamicDecoder {
Nb(SpeexDecoder<NbMode>),
Wb(SpeexDecoder<WbMode>),
Uwb(SpeexDecoder<UwbMode>),
}Expand description
An enumeration over the different encoder modes. For usecases where the decoder mode is not known at compile time.
Variants§
Implementations§
Source§impl DynamicDecoder
impl DynamicDecoder
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_enhancement(&mut self, state: bool)
pub fn set_enhancement(&mut self, state: bool)
Set whether to use enhancement.
Sourcepub fn get_enhancement(&mut self) -> bool
pub fn get_enhancement(&mut self) -> bool
Get whether enhancement is turned on or not.
Sourcepub fn decode(
&mut self,
bits: &mut SpeexBits<'_>,
out: &mut [f32],
) -> Result<(), DecoderError>
pub fn decode( &mut self, bits: &mut SpeexBits<'_>, out: &mut [f32], ) -> Result<(), DecoderError>
Decode one frame of speex data from the bitstream
Sourcepub fn decode_to_owned(
&mut self,
bits: &mut SpeexBits<'_>,
) -> Result<Vec<f32>, DecoderError>
pub fn decode_to_owned( &mut self, bits: &mut SpeexBits<'_>, ) -> Result<Vec<f32>, DecoderError>
Decode one frame of speex data from the bitstream into a new Vec
Sourcepub fn decode_int(
&mut self,
bits: &mut SpeexBits<'_>,
out: &mut [i16],
) -> Result<(), DecoderError>
pub fn decode_int( &mut self, bits: &mut SpeexBits<'_>, out: &mut [i16], ) -> Result<(), DecoderError>
Decode one frame of speex data from the bitstream, as i16
Sourcepub fn decode_int_to_owned(
&mut self,
bits: &mut SpeexBits<'_>,
) -> Result<Vec<i16>, DecoderError>
pub fn decode_int_to_owned( &mut self, bits: &mut SpeexBits<'_>, ) -> Result<Vec<i16>, DecoderError>
Decode one frame of speex data from the bitstream into a new Vec