fix(audio): use WebRTC VAD on iOS
This commit is contained in:
@@ -100,6 +100,16 @@ pub enum VadBackend {
|
||||
Disabled,
|
||||
}
|
||||
|
||||
#[cfg(target_os = "ios")]
|
||||
fn default_vad_backend() -> VadBackend {
|
||||
VadBackend::WebrtcVad
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
fn default_vad_backend() -> VadBackend {
|
||||
VadBackend::SileroOnnx
|
||||
}
|
||||
|
||||
impl VadBackend {
|
||||
/// Stable bridge/debug string.
|
||||
pub fn as_str(self) -> &'static str {
|
||||
@@ -164,7 +174,7 @@ impl Default for AudioProcessingConfig {
|
||||
route: AudioRoute::Speaker,
|
||||
ios_mode: IosVoiceProcessingMode::PlatformVoiceProcessing,
|
||||
processing_backend: AudioBackend::PlatformVoiceProcessing,
|
||||
vad_backend: VadBackend::SileroOnnx,
|
||||
vad_backend: default_vad_backend(),
|
||||
aec: EffectOwner::Platform,
|
||||
// iOS VPIO owns NS/AGC on the default shipping path. Software
|
||||
// effects are opt-in through the experimental raw route only.
|
||||
@@ -242,6 +252,9 @@ mod tests {
|
||||
assert_eq!(config.aec, EffectOwner::Platform);
|
||||
assert_eq!(config.ns, EffectOwner::Platform);
|
||||
assert_eq!(config.agc, EffectOwner::Platform);
|
||||
#[cfg(target_os = "ios")]
|
||||
assert_eq!(config.vad_backend, VadBackend::WebrtcVad);
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
assert_eq!(config.vad_backend, VadBackend::SileroOnnx);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user