pub struct AudioProcessingOptions {
pub echo_cancellation: bool,
pub noise_suppression: bool,
pub auto_gain_control: bool,
pub prefer_hardware_processing: bool,
}Expand description
Configuration options for audio processing (AEC, AGC, NS).
§Platform Behavior
-
iOS: Hardware processing via VPIO is always used and provides excellent AEC/AGC/NS. The
prefer_hardware_processingdefault istrueon iOS. -
Android: Hardware AEC quality varies significantly across manufacturers and device models. Many devices have broken or poorly-tuned hardware AEC. The default is
falseto use WebRTC’s reliable software processing. See: https://github.com/react-native-webrtc/react-native-webrtc/issues/713 -
Desktop (macOS, Windows, Linux): Hardware processing is not available. WebRTC’s software Audio Processing Module (APM) is always used. The
prefer_hardware_processingsetting is ignored.
§Example
use livekit::AudioProcessingOptions;
// Use platform-appropriate defaults
let opts = AudioProcessingOptions::default();
// Disable echo cancellation
let opts = AudioProcessingOptions {
echo_cancellation: false,
..Default::default()
};
// Force software processing on iOS (not recommended)
let opts = AudioProcessingOptions {
prefer_hardware_processing: false,
..Default::default()
};Fields§
§echo_cancellation: boolEnable echo cancellation.
Echo cancellation removes acoustic echo from the microphone signal, which occurs when the speaker output is picked up by the microphone.
Default: true
noise_suppression: boolEnable noise suppression.
Noise suppression reduces background noise in the microphone signal.
Default: true
auto_gain_control: boolEnable automatic gain control.
AGC automatically adjusts the microphone volume to maintain consistent audio levels.
Default: true
prefer_hardware_processing: boolPrefer hardware audio processing when available.
§Platform Defaults
-
iOS:
true- VPIO hardware processing is excellent and always used. Apple’s Voice Processing IO unit provides reliable, low-latency AEC/AGC/NS that is tightly integrated with the audio hardware. -
Android:
false- Hardware AEC is unreliable on many devices. Quality varies significantly across manufacturers (Samsung, Xiaomi, etc.) and even across models from the same manufacturer. WebRTC’s software AEC provides consistent behavior across all Android devices. Reference: Meta found hardware AEC “broken on many combinations of HW + OS” when supporting billions of users across thousands of device models. -
Desktop:
false- Hardware processing is not available. This setting is ignored; WebRTC software APM is always used.
Trait Implementations§
Source§impl Clone for AudioProcessingOptions
impl Clone for AudioProcessingOptions
Source§fn clone(&self) -> AudioProcessingOptions
fn clone(&self) -> AudioProcessingOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AudioProcessingOptions
Source§impl Debug for AudioProcessingOptions
impl Debug for AudioProcessingOptions
Source§impl Default for AudioProcessingOptions
impl Default for AudioProcessingOptions
impl Eq for AudioProcessingOptions
Source§impl PartialEq for AudioProcessingOptions
impl PartialEq for AudioProcessingOptions
impl StructuralPartialEq for AudioProcessingOptions
Auto Trait Implementations§
impl Freeze for AudioProcessingOptions
impl RefUnwindSafe for AudioProcessingOptions
impl Send for AudioProcessingOptions
impl Sync for AudioProcessingOptions
impl Unpin for AudioProcessingOptions
impl UnsafeUnpin for AudioProcessingOptions
impl UnwindSafe for AudioProcessingOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.