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
impl AudioProcessing
Sourcepub fn new(config: &InitializationConfig) -> Result<Self, Error>
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.
Sourcepub fn process_capture_frame(&self, frame: &mut [Vec<f32>]) -> Result<(), Error>
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.
Sourcepub fn process_render_frame(&self, frame: &mut [Vec<f32>]) -> Result<(), Error>
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.
Sourcepub fn get_stats(&self) -> Stats
pub fn get_stats(&self) -> Stats
Returns statistics from the last process_capture_frame() call.
Sourcepub fn set_config(&self, config: Config)
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.
Sourcepub fn set_output_will_be_muted(&self, muted: bool)
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.
Sourcepub fn set_stream_key_pressed(&self, pressed: bool)
pub fn set_stream_key_pressed(&self, pressed: bool)
Signals the AEC and AGC that the next frame will contain key press sound