feat(audio): add Apple CoreML Silero VAD
This commit is contained in:
@@ -30,7 +30,7 @@ pub fn ios_route_policy(route: AudioRoute) -> AudioProcessingConfig {
|
||||
route,
|
||||
ios_mode: IosVoiceProcessingMode::PlatformVoiceProcessing,
|
||||
processing_backend: AudioBackend::PlatformVoiceProcessing,
|
||||
vad_backend: VadBackend::WebrtcVad,
|
||||
vad_backend: VadBackend::SileroOnnx,
|
||||
aec: EffectOwner::Platform,
|
||||
// VPIO owns NS and AGC on the shipping default path (IOSP_002/003).
|
||||
ns: EffectOwner::Platform,
|
||||
@@ -43,7 +43,7 @@ pub fn ios_route_policy(route: AudioRoute) -> AudioProcessingConfig {
|
||||
route,
|
||||
ios_mode: IosVoiceProcessingMode::PlatformVoiceProcessing,
|
||||
processing_backend: AudioBackend::Noop,
|
||||
vad_backend: VadBackend::WebrtcVad,
|
||||
vad_backend: VadBackend::SileroOnnx,
|
||||
// No AEC needed for wired headset (no acoustic echo path).
|
||||
aec: EffectOwner::Off,
|
||||
// Conservative NS/AGC: optional, not forced.
|
||||
@@ -57,7 +57,7 @@ pub fn ios_route_policy(route: AudioRoute) -> AudioProcessingConfig {
|
||||
route,
|
||||
ios_mode: IosVoiceProcessingMode::PlatformVoiceProcessing,
|
||||
processing_backend: AudioBackend::PlatformVoiceProcessing,
|
||||
vad_backend: VadBackend::WebrtcVad,
|
||||
vad_backend: VadBackend::SileroOnnx,
|
||||
// BT HFP manages its own AEC in the headset firmware.
|
||||
aec: EffectOwner::Off,
|
||||
ns: EffectOwner::Conservative,
|
||||
@@ -87,7 +87,7 @@ pub fn ios_route_policy(route: AudioRoute) -> AudioProcessingConfig {
|
||||
route,
|
||||
ios_mode: IosVoiceProcessingMode::PlatformVoiceProcessing,
|
||||
processing_backend: AudioBackend::Noop,
|
||||
vad_backend: VadBackend::WebrtcVad,
|
||||
vad_backend: VadBackend::SileroOnnx,
|
||||
// Safe fallback: AEC off until route is classified.
|
||||
aec: EffectOwner::Off,
|
||||
ns: EffectOwner::Off,
|
||||
@@ -146,7 +146,7 @@ mod tests {
|
||||
cfg.ios_mode,
|
||||
IosVoiceProcessingMode::PlatformVoiceProcessing
|
||||
);
|
||||
assert_eq!(cfg.vad_backend, VadBackend::WebrtcVad);
|
||||
assert_eq!(cfg.vad_backend, VadBackend::SileroOnnx);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -157,7 +157,7 @@ mod tests {
|
||||
AudioBackend::PlatformVoiceProcessing
|
||||
);
|
||||
assert_eq!(cfg.aec, EffectOwner::Platform);
|
||||
assert_eq!(cfg.vad_backend, VadBackend::WebrtcVad);
|
||||
assert_eq!(cfg.vad_backend, VadBackend::SileroOnnx);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -165,14 +165,14 @@ mod tests {
|
||||
let cfg = ios_route_policy(AudioRoute::WiredHeadset);
|
||||
assert_eq!(cfg.aec, EffectOwner::Off);
|
||||
assert_eq!(cfg.processing_backend, AudioBackend::Noop);
|
||||
assert_eq!(cfg.vad_backend, VadBackend::WebrtcVad);
|
||||
assert_eq!(cfg.vad_backend, VadBackend::SileroOnnx);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bluetooth_hfp_disables_app_aec() {
|
||||
let cfg = ios_route_policy(AudioRoute::BluetoothHfp);
|
||||
assert_eq!(cfg.aec, EffectOwner::Off);
|
||||
assert_eq!(cfg.vad_backend, VadBackend::WebrtcVad);
|
||||
assert_eq!(cfg.vad_backend, VadBackend::SileroOnnx);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -187,7 +187,7 @@ mod tests {
|
||||
fn unknown_route_safe_fallback_no_aec() {
|
||||
let cfg = ios_route_policy(AudioRoute::Unknown);
|
||||
assert_eq!(cfg.aec, EffectOwner::Off);
|
||||
assert_eq!(cfg.vad_backend, VadBackend::WebrtcVad);
|
||||
assert_eq!(cfg.vad_backend, VadBackend::SileroOnnx);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user