mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	echo-cancel: Add a modarg toggle for VAD in the webrtc canceller
This commit is contained in:
		
							parent
							
								
									90608feac0
								
							
						
					
					
						commit
						8949ed96c6
					
				
					 1 changed files with 11 additions and 2 deletions
				
			
		| 
						 | 
					@ -47,6 +47,7 @@ PA_C_DECL_END
 | 
				
			||||||
#define DEFAULT_ROUTING_MODE "speakerphone"
 | 
					#define DEFAULT_ROUTING_MODE "speakerphone"
 | 
				
			||||||
#define DEFAULT_COMFORT_NOISE true
 | 
					#define DEFAULT_COMFORT_NOISE true
 | 
				
			||||||
#define DEFAULT_DRIFT_COMPENSATION false
 | 
					#define DEFAULT_DRIFT_COMPENSATION false
 | 
				
			||||||
 | 
					#define DEFAULT_VAD true
 | 
				
			||||||
#define DEFAULT_EXTENDED_FILTER false
 | 
					#define DEFAULT_EXTENDED_FILTER false
 | 
				
			||||||
#define DEFAULT_INTELLIGIBILITY_ENHANCER false
 | 
					#define DEFAULT_INTELLIGIBILITY_ENHANCER false
 | 
				
			||||||
#define DEFAULT_EXPERIMENTAL_AGC false
 | 
					#define DEFAULT_EXPERIMENTAL_AGC false
 | 
				
			||||||
| 
						 | 
					@ -64,6 +65,7 @@ static const char* const valid_modargs[] = {
 | 
				
			||||||
    "routing_mode",
 | 
					    "routing_mode",
 | 
				
			||||||
    "comfort_noise",
 | 
					    "comfort_noise",
 | 
				
			||||||
    "drift_compensation",
 | 
					    "drift_compensation",
 | 
				
			||||||
 | 
					    "voice_detection",
 | 
				
			||||||
    "extended_filter",
 | 
					    "extended_filter",
 | 
				
			||||||
    "intelligibility_enhancer",
 | 
					    "intelligibility_enhancer",
 | 
				
			||||||
    "experimental_agc",
 | 
					    "experimental_agc",
 | 
				
			||||||
| 
						 | 
					@ -143,7 +145,7 @@ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec,
 | 
				
			||||||
    webrtc::AudioProcessing *apm = NULL;
 | 
					    webrtc::AudioProcessing *apm = NULL;
 | 
				
			||||||
    webrtc::ProcessingConfig pconfig;
 | 
					    webrtc::ProcessingConfig pconfig;
 | 
				
			||||||
    webrtc::Config config;
 | 
					    webrtc::Config config;
 | 
				
			||||||
    bool hpf, ns, agc, dgc, mobile, cn, ext_filter, intelligibility, experimental_agc;
 | 
					    bool hpf, ns, agc, dgc, mobile, cn, vad, ext_filter, intelligibility, experimental_agc;
 | 
				
			||||||
    int rm = -1;
 | 
					    int rm = -1;
 | 
				
			||||||
    pa_modargs *ma;
 | 
					    pa_modargs *ma;
 | 
				
			||||||
    bool trace = false;
 | 
					    bool trace = false;
 | 
				
			||||||
| 
						 | 
					@ -217,6 +219,12 @@ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec,
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    vad = DEFAULT_VAD;
 | 
				
			||||||
 | 
					    if (pa_modargs_get_value_boolean(ma, "voice_detection", &vad) < 0) {
 | 
				
			||||||
 | 
					        pa_log("Failed to parse voice_detection value");
 | 
				
			||||||
 | 
					        goto fail;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ext_filter = DEFAULT_EXTENDED_FILTER;
 | 
					    ext_filter = DEFAULT_EXTENDED_FILTER;
 | 
				
			||||||
    if (pa_modargs_get_value_boolean(ma, "extended_filter", &ext_filter) < 0) {
 | 
					    if (pa_modargs_get_value_boolean(ma, "extended_filter", &ext_filter) < 0) {
 | 
				
			||||||
        pa_log("Failed to parse extended_filter value");
 | 
					        pa_log("Failed to parse extended_filter value");
 | 
				
			||||||
| 
						 | 
					@ -304,6 +312,7 @@ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec,
 | 
				
			||||||
        apm->gain_control()->Enable(true);
 | 
					        apm->gain_control()->Enable(true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (vad)
 | 
				
			||||||
        apm->voice_detection()->Enable(true);
 | 
					        apm->voice_detection()->Enable(true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ec->params.priv.webrtc.apm = apm;
 | 
					    ec->params.priv.webrtc.apm = apm;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue