SpeexEncoder

Struct SpeexEncoder 

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

A struct representing a speex encoder.

Fields§

§mode: &'static SpeexMode

Implementations§

Source§

impl<T: CoderMode> SpeexEncoder<T>

Source

pub fn set_complexity(&mut self, complexity: i32)

Sets the analysis complexity of the encoder.

Source

pub fn get_complexity(&mut self) -> i32

Gets the analysis complexity of the encoder.

Source

pub fn encode(&mut self, input: &mut [f32], bits: &mut SpeexBits<'_>)

Encode one frame of audio into the given bits.

Source

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.

Source§

impl SpeexEncoder<NbMode>

Source

pub fn new() -> SpeexEncoder<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 SpeexEncoder<WbMode>

Source

pub fn new() -> SpeexEncoder<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 SpeexEncoder<UwbMode>

Source

pub fn new() -> SpeexEncoder<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 SpeexEncoder<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 SpeexEncoder<NbMode>

Source§

fn default() -> Self

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

impl Default for SpeexEncoder<UwbMode>

Source§

fn default() -> Self

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

impl Default for SpeexEncoder<WbMode>

Source§

fn default() -> Self

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

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

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<T> Freeze for SpeexEncoder<T>

§

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

§

impl<T> !Send for SpeexEncoder<T>

§

impl<T> !Sync for SpeexEncoder<T>

§

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

§

impl<T> UnwindSafe for SpeexEncoder<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.