SpeexDecoder

Struct SpeexDecoder 

Source
pub struct SpeexDecoder<T: CoderMode> {
    pub mode: &'static SpeexMode,
    /* private fields */
}
Expand description

A struct representing a speex decoder.

Fields§

§mode: &'static SpeexMode

Implementations§

Source§

impl<T: CoderMode> SpeexDecoder<T>

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§

impl SpeexDecoder<NbMode>

Source

pub fn new() -> SpeexDecoder<NbMode>

Create a new narrowband encoder.

Source

pub fn set_submode(&mut self, submode: NbSubmodeId)

Sets the submode to use for encoding.

Source

pub fn get_submode(&mut self) -> NbSubmodeId

Gets the submode currently in use for encoding.

Source§

impl SpeexDecoder<WbMode>

Source

pub fn new() -> SpeexDecoder<WbMode>

Create a new WideBand encoder.

Source

pub fn set_low_submode(&mut self, low_mode: NbSubmodeId)

Sets the submode of the narrowband part of the encoder.

Source

pub fn get_low_submode(&mut self) -> NbSubmodeId

Gets the submode of the narrowband part of the encoder.

Source

pub fn set_high_submode(&mut self, high_mode: WbSubmodeId)

Sets the submode of the wideband part of the encoder.

Source

pub fn get_high_submode(&mut self) -> WbSubmodeId

Gets the submode of the wideband part of the encoder.

Source§

impl SpeexDecoder<UwbMode>

Source

pub fn new() -> SpeexDecoder<UwbMode>

Create a new Ultra WideBand encoder.

Source

pub fn set_low_submode(&mut self, low_mode: NbSubmodeId)

Sets the submode of the narrowband part of the encoder.

Source

pub fn get_low_submode(&mut self) -> NbSubmodeId

Gets the submode of the narrowband part of the encoder.

Trait Implementations§

Source§

impl<T: CoderMode> ControlFunctions for SpeexDecoder<T>

Source§

unsafe fn ctl( &mut self, request: i32, ptr: *mut c_void, ) -> Result<(), ControlError>

Calls a control function of the underlying speex library Read more
Source§

fn check_error(err_code: i32, param: Option<i32>) -> Result<(), ControlError>

Internal function used to convert the error codes returned by the control function into a result type
Source§

fn get_frame_size(&mut self) -> i32

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

fn set_vbr(&mut self, vbr: bool)

Sets whether Variable BitRate is enabled or not
Source§

fn get_vbr(&mut self) -> bool

Gets whether Variable BitRate is enabled or not
Source§

fn set_vbr_quality(&mut self, quality: f32)

Sets the VBR quality of the encoder/decoder Read more
Source§

fn get_vbr_quality(&mut self) -> f32

Gets the VBR quality of the encoder/decoder
Source§

fn set_vad(&mut self, vad: bool)

Sets whether Voice Activity Detection is enabled or not
Source§

fn get_vad(&mut self) -> bool

Gets whether Voice Activity Detection is enabled or not
Source§

fn set_abr(&mut self, abr: i32)

Sets the Average BitRate of the encoder/decoder
Source§

fn get_abr(&mut self) -> i32

Gets the Average BitRate of the encoder/decoder
Source§

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§

fn set_bitrate(&mut self, bitrate: i32)

Sets the current bitrate of the encoder/decoder
Source§

fn get_bitrate(&mut self) -> i32

Gets the current bitrate of the encoder/decoder
Source§

fn set_sampling_rate(&mut self, samplingrate: i32)

Sets the sampling rate used for bitrate computation
Source§

fn get_sampling_rate(&mut self) -> i32

Gets the sampling rate used for bitrate computation
Source§

fn reset_state(&mut self)

resets the encoder/decoder memories to zero
Source§

fn set_submode_encoding(&mut self, submode: bool)

Sets whether submode encoding is done in each frame Read more
Source§

fn get_submode_encoding(&mut self) -> bool

Gets whether submode encoding is enabled or not
Source§

fn get_lookahead(&mut self) -> i32

Gets the lookahead value currently in use by the encoder/decoder Read more
Source§

fn set_plc_tuning(&mut self, tuning: i32)

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

fn get_plc_tuning(&mut self) -> i32

Gets current Packet-Loss Concealment tuning value
Source§

fn set_vbr_max_bitrate(&mut self, max_bitrate: i32)

Sets the max bit-rate allowed in VBR mode
Source§

fn get_vbr_max_bitrate(&mut self) -> i32

Gets the max bit-rate allowed in VBR mode
Source§

fn set_highpass(&mut self, highpass: bool)

Enables or disables highpass filtering of the input/output
Source§

fn get_highpass(&mut self) -> bool

Gets whether highpass filtering of the input/output is enabled
Source§

impl Default for SpeexDecoder<NbMode>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Default for SpeexDecoder<UwbMode>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Default for SpeexDecoder<WbMode>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T: CoderMode> Drop for SpeexDecoder<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<T> Freeze for SpeexDecoder<T>

§

impl<T> RefUnwindSafe for SpeexDecoder<T>
where T: RefUnwindSafe,

§

impl<T> !Send for SpeexDecoder<T>

§

impl<T> !Sync for SpeexDecoder<T>

§

impl<T> Unpin for SpeexDecoder<T>
where T: Unpin,

§

impl<T> UnwindSafe for SpeexDecoder<T>
where T: UnwindSafe,

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.