DynamicDecoder

Enum DynamicDecoder 

Source
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

Source

pub fn get_frame_size(&mut self) -> i32

Gets the frame size (in samples) of the encoder/decoder

Source

pub fn set_vbr(&mut self, vbr: bool)

Sets whether Variable BitRate is enabled or not

Source

pub fn get_vbr(&mut self) -> bool

Gets whether Variable BitRate is enabled or not

Source

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.

Source

pub fn get_vbr_quality(&mut self) -> f32

Gets the VBR quality of the encoder/decoder

Source

pub fn set_vad(&mut self, vad: bool)

Sets whether Voice Activity Detection is enabled or not

Source

pub fn get_vad(&mut self) -> bool

Gets whether Voice Activity Detection is enabled or not

Source

pub fn set_abr(&mut self, abr: i32)

Sets the Average BitRate of the encoder/decoder

Source

pub fn get_abr(&mut self) -> i32

Gets the Average BitRate of the encoder/decoder

Source

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.

Source

pub fn set_bitrate(&mut self, bitrate: i32)

Sets the current bitrate of the encoder/decoder

Source

pub fn get_bitrate(&mut self) -> i32

Gets the current bitrate of the encoder/decoder

Source

pub fn set_sampling_rate(&mut self, samplingrate: i32)

Sets the sampling rate used for bitrate computation

Source

pub fn get_sampling_rate(&mut self) -> i32

Gets the sampling rate used for bitrate computation

Source

pub fn reset_state(&mut self)

resets the encoder/decoder memories to zero

Source

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

Source

pub fn get_submode_encoding(&mut self) -> bool

Gets whether submode encoding is enabled or not

Source

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.

Source

pub fn set_plc_tuning(&mut self, tuning: i32)

Sets tuning for Packet-Loss Concealment (expected loss rate)

Source

pub fn get_plc_tuning(&mut self) -> i32

Gets current Packet-Loss Concealment tuning value

Source

pub fn set_vbr_max_bitrate(&mut self, max_bitrate: i32)

Sets the max bit-rate allowed in VBR mode

Source

pub fn get_vbr_max_bitrate(&mut self) -> i32

Gets the max bit-rate allowed in VBR mode

Source

pub fn set_highpass(&mut self, highpass: bool)

Enables or disables highpass filtering of the input/output

Source

pub fn get_highpass(&mut self) -> bool

Gets whether highpass filtering of the input/output is enabled

Source

pub fn set_enhancement(&mut self, state: bool)

Set whether to use enhancement.

Source

pub fn get_enhancement(&mut self) -> bool

Get whether enhancement is turned on or not.

Source

pub fn decode( &mut self, bits: &mut SpeexBits<'_>, out: &mut [f32], ) -> Result<(), DecoderError>

Decode one frame of speex data from the bitstream

Source

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

Source

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

Source

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

Source

pub fn new(mode: ModeId) -> DynamicDecoder

Source

pub fn into_nb(self) -> Option<SpeexDecoder<NbMode>>

Source

pub fn into_wb(self) -> Option<SpeexDecoder<WbMode>>

Source

pub fn into_uwb(self) -> Option<SpeexDecoder<UwbMode>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.