OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 } | 266 } |
267 if (settings_.use_ie) { | 267 if (settings_.use_ie) { |
268 config.Set<Intelligibility>(new Intelligibility(*settings_.use_ie)); | 268 config.Set<Intelligibility>(new Intelligibility(*settings_.use_ie)); |
269 } | 269 } |
270 if (settings_.use_aec3) { | 270 if (settings_.use_aec3) { |
271 config.Set<EchoCanceller3>(new EchoCanceller3(*settings_.use_aec3)); | 271 config.Set<EchoCanceller3>(new EchoCanceller3(*settings_.use_aec3)); |
272 } | 272 } |
273 if (settings_.use_lc) { | 273 if (settings_.use_lc) { |
274 apm_config.level_controller.enabled = *settings_.use_lc; | 274 apm_config.level_controller.enabled = *settings_.use_lc; |
275 } | 275 } |
| 276 if (settings_.use_hpf) { |
| 277 apm_config.high_pass_filter.enabled = *settings_.use_hpf; |
| 278 } |
| 279 |
276 if (settings_.use_refined_adaptive_filter) { | 280 if (settings_.use_refined_adaptive_filter) { |
277 config.Set<RefinedAdaptiveFilter>( | 281 config.Set<RefinedAdaptiveFilter>( |
278 new RefinedAdaptiveFilter(*settings_.use_refined_adaptive_filter)); | 282 new RefinedAdaptiveFilter(*settings_.use_refined_adaptive_filter)); |
279 } | 283 } |
280 config.Set<ExtendedFilter>(new ExtendedFilter( | 284 config.Set<ExtendedFilter>(new ExtendedFilter( |
281 !settings_.use_extended_filter || *settings_.use_extended_filter)); | 285 !settings_.use_extended_filter || *settings_.use_extended_filter)); |
282 config.Set<DelayAgnostic>(new DelayAgnostic(!settings_.use_delay_agnostic || | 286 config.Set<DelayAgnostic>(new DelayAgnostic(!settings_.use_delay_agnostic || |
283 *settings_.use_delay_agnostic)); | 287 *settings_.use_delay_agnostic)); |
284 if (settings_.use_ed) { | 288 if (settings_.use_ed) { |
285 apm_config.residual_echo_detector.enabled = *settings_.use_ed; | 289 apm_config.residual_echo_detector.enabled = *settings_.use_ed; |
286 } | 290 } |
287 | 291 |
288 ap_.reset(AudioProcessing::Create(config)); | 292 ap_.reset(AudioProcessing::Create(config)); |
289 RTC_CHECK(ap_); | 293 RTC_CHECK(ap_); |
290 | 294 |
291 ap_->ApplyConfig(apm_config); | 295 ap_->ApplyConfig(apm_config); |
292 | 296 |
293 if (settings_.use_aec) { | 297 if (settings_.use_aec) { |
294 RTC_CHECK_EQ(AudioProcessing::kNoError, | 298 RTC_CHECK_EQ(AudioProcessing::kNoError, |
295 ap_->echo_cancellation()->Enable(*settings_.use_aec)); | 299 ap_->echo_cancellation()->Enable(*settings_.use_aec)); |
296 } | 300 } |
297 if (settings_.use_aecm) { | 301 if (settings_.use_aecm) { |
298 RTC_CHECK_EQ(AudioProcessing::kNoError, | 302 RTC_CHECK_EQ(AudioProcessing::kNoError, |
299 ap_->echo_control_mobile()->Enable(*settings_.use_aecm)); | 303 ap_->echo_control_mobile()->Enable(*settings_.use_aecm)); |
300 } | 304 } |
301 if (settings_.use_agc) { | 305 if (settings_.use_agc) { |
302 RTC_CHECK_EQ(AudioProcessing::kNoError, | 306 RTC_CHECK_EQ(AudioProcessing::kNoError, |
303 ap_->gain_control()->Enable(*settings_.use_agc)); | 307 ap_->gain_control()->Enable(*settings_.use_agc)); |
304 } | 308 } |
305 if (settings_.use_hpf) { | |
306 RTC_CHECK_EQ(AudioProcessing::kNoError, | |
307 ap_->high_pass_filter()->Enable(*settings_.use_hpf)); | |
308 } | |
309 if (settings_.use_ns) { | 309 if (settings_.use_ns) { |
310 RTC_CHECK_EQ(AudioProcessing::kNoError, | 310 RTC_CHECK_EQ(AudioProcessing::kNoError, |
311 ap_->noise_suppression()->Enable(*settings_.use_ns)); | 311 ap_->noise_suppression()->Enable(*settings_.use_ns)); |
312 } | 312 } |
313 if (settings_.use_le) { | 313 if (settings_.use_le) { |
314 RTC_CHECK_EQ(AudioProcessing::kNoError, | 314 RTC_CHECK_EQ(AudioProcessing::kNoError, |
315 ap_->level_estimator()->Enable(*settings_.use_le)); | 315 ap_->level_estimator()->Enable(*settings_.use_le)); |
316 } | 316 } |
317 if (settings_.use_vad) { | 317 if (settings_.use_vad) { |
318 RTC_CHECK_EQ(AudioProcessing::kNoError, | 318 RTC_CHECK_EQ(AudioProcessing::kNoError, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 size_t kMaxFilenameSize = AudioProcessing::kMaxFilenameSize; | 382 size_t kMaxFilenameSize = AudioProcessing::kMaxFilenameSize; |
383 RTC_CHECK_LE(settings_.aec_dump_output_filename->size(), kMaxFilenameSize); | 383 RTC_CHECK_LE(settings_.aec_dump_output_filename->size(), kMaxFilenameSize); |
384 RTC_CHECK_EQ(AudioProcessing::kNoError, | 384 RTC_CHECK_EQ(AudioProcessing::kNoError, |
385 ap_->StartDebugRecording( | 385 ap_->StartDebugRecording( |
386 settings_.aec_dump_output_filename->c_str(), -1)); | 386 settings_.aec_dump_output_filename->c_str(), -1)); |
387 } | 387 } |
388 } | 388 } |
389 | 389 |
390 } // namespace test | 390 } // namespace test |
391 } // namespace webrtc | 391 } // namespace webrtc |
OLD | NEW |