AudioProcessing

Struct AudioProcessing 

Source
pub struct AudioProcessing { /* private fields */ }
Expand description

AudioProcessing provides access to webrtc’s audio processing e.g. echo cancellation and automatic gain control. This is a low level API that may require wrapping in an Arc to be shared between threads, depending on the use case. See Processor for a simple wrapper around this API that enables sharing the processor between threads.

Implementations§

Source§

impl AudioProcessing

Source

pub fn new(config: &InitializationConfig) -> Result<Self, Error>

Creates a new Processor. InitializationConfig is only used on instantiation, however new configs can be be passed to set_config() at any time during processing.

Source

pub fn process_capture_frame(&self, frame: &mut [Vec<f32>]) -> Result<(), Error>

Processes and modifies the audio frame from a capture device by applying signal processing as specified in the config. frame should be a Vec of length ‘num_capture_channels’, with each inner Vec representing a channel with NUM_SAMPLES_PER_FRAME samples.

Source

pub fn process_render_frame(&self, frame: &mut [Vec<f32>]) -> Result<(), Error>

Processes and optionally modifies the audio frame from a playback device. frame should be a Vec of length ‘num_render_channels’, with each inner Vec representing a channel with NUM_SAMPLES_PER_FRAME samples.

Source

pub fn get_stats(&self) -> Stats

Returns statistics from the last process_capture_frame() call.

Source

pub fn set_config(&self, config: Config)

Immediately updates the configurations of the internal signal processor. May be called multiple times after the initialization and during processing.

Source

pub fn set_output_will_be_muted(&self, muted: bool)

Signals the AEC and AGC that the audio output will be / is muted. They may use the hint to improve their parameter adaptation.

Source

pub fn set_stream_key_pressed(&self, pressed: bool)

Signals the AEC and AGC that the next frame will contain key press sound

Trait Implementations§

Source§

impl Drop for AudioProcessing

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for AudioProcessing

Source§

impl Sync for AudioProcessing

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.