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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
201 } | 201 } |
202 | 202 |
203 void AudioProcessingSimulator::DestroyAudioProcessor() { | 203 void AudioProcessingSimulator::DestroyAudioProcessor() { |
204 if (settings_.aec_dump_output_filename) { | 204 if (settings_.aec_dump_output_filename) { |
205 RTC_CHECK_EQ(AudioProcessing::kNoError, ap_->StopDebugRecording()); | 205 RTC_CHECK_EQ(AudioProcessing::kNoError, ap_->StopDebugRecording()); |
206 } | 206 } |
207 } | 207 } |
208 | 208 |
209 void AudioProcessingSimulator::CreateAudioProcessor() { | 209 void AudioProcessingSimulator::CreateAudioProcessor() { |
210 Config config; | 210 Config config; |
211 AudioProcessing::Config apm_config; | |
211 if (settings_.use_bf && *settings_.use_bf) { | 212 if (settings_.use_bf && *settings_.use_bf) { |
212 config.Set<Beamforming>(new Beamforming( | 213 config.Set<Beamforming>(new Beamforming( |
213 true, ParseArrayGeometry(*settings_.microphone_positions), | 214 true, ParseArrayGeometry(*settings_.microphone_positions), |
214 SphericalPointf(DegreesToRadians(settings_.target_angle_degrees), 0.f, | 215 SphericalPointf(DegreesToRadians(settings_.target_angle_degrees), 0.f, |
215 1.f))); | 216 1.f))); |
216 } | 217 } |
217 if (settings_.use_ts) { | 218 if (settings_.use_ts) { |
218 config.Set<ExperimentalNs>(new ExperimentalNs(*settings_.use_ts)); | 219 config.Set<ExperimentalNs>(new ExperimentalNs(*settings_.use_ts)); |
219 } | 220 } |
220 if (settings_.use_ie) { | 221 if (settings_.use_ie) { |
221 config.Set<Intelligibility>(new Intelligibility(*settings_.use_ie)); | 222 config.Set<Intelligibility>(new Intelligibility(*settings_.use_ie)); |
222 } | 223 } |
223 if (settings_.use_aec3) { | 224 if (settings_.use_aec3) { |
224 config.Set<EchoCanceller3>(new EchoCanceller3(*settings_.use_aec3)); | 225 config.Set<EchoCanceller3>(new EchoCanceller3(*settings_.use_aec3)); |
225 } | 226 } |
226 if (settings_.use_lc) { | 227 if (settings_.use_lc) { |
227 config.Set<LevelControl>(new LevelControl(true)); | 228 apm_config.level_controller.enabled = *settings_.use_lc; |
228 } | 229 } |
229 if (settings_.use_refined_adaptive_filter) { | 230 if (settings_.use_refined_adaptive_filter) { |
230 config.Set<RefinedAdaptiveFilter>( | 231 config.Set<RefinedAdaptiveFilter>( |
231 new RefinedAdaptiveFilter(*settings_.use_refined_adaptive_filter)); | 232 new RefinedAdaptiveFilter(*settings_.use_refined_adaptive_filter)); |
232 } | 233 } |
233 config.Set<ExtendedFilter>(new ExtendedFilter( | 234 config.Set<ExtendedFilter>(new ExtendedFilter( |
234 !settings_.use_extended_filter || *settings_.use_extended_filter)); | 235 !settings_.use_extended_filter || *settings_.use_extended_filter)); |
235 config.Set<DelayAgnostic>(new DelayAgnostic(!settings_.use_delay_agnostic || | 236 config.Set<DelayAgnostic>(new DelayAgnostic(!settings_.use_delay_agnostic || |
236 *settings_.use_delay_agnostic)); | 237 *settings_.use_delay_agnostic)); |
237 | 238 |
238 ap_.reset(AudioProcessing::Create(config)); | 239 ap_.reset(AudioProcessing::Create(config)); |
240 RTC_CHECK(ap_); | |
241 | |
242 RTC_DCHECK(apm_config.Validate()); | |
the sun
2016/09/01 13:48:01
dd
peah-webrtc
2016/09/02 08:22:03
Done.
| |
243 RTC_DCHECK(ap_->ApplyConfig(apm_config)); | |
239 | 244 |
240 if (settings_.use_aec) { | 245 if (settings_.use_aec) { |
241 RTC_CHECK_EQ(AudioProcessing::kNoError, | 246 RTC_CHECK_EQ(AudioProcessing::kNoError, |
242 ap_->echo_cancellation()->Enable(*settings_.use_aec)); | 247 ap_->echo_cancellation()->Enable(*settings_.use_aec)); |
243 } | 248 } |
244 if (settings_.use_aecm) { | 249 if (settings_.use_aecm) { |
245 RTC_CHECK_EQ(AudioProcessing::kNoError, | 250 RTC_CHECK_EQ(AudioProcessing::kNoError, |
246 ap_->echo_control_mobile()->Enable(*settings_.use_aecm)); | 251 ap_->echo_control_mobile()->Enable(*settings_.use_aecm)); |
247 } | 252 } |
248 if (settings_.use_agc) { | 253 if (settings_.use_agc) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 size_t kMaxFilenameSize = AudioProcessing::kMaxFilenameSize; | 334 size_t kMaxFilenameSize = AudioProcessing::kMaxFilenameSize; |
330 RTC_CHECK_LE(settings_.aec_dump_output_filename->size(), kMaxFilenameSize); | 335 RTC_CHECK_LE(settings_.aec_dump_output_filename->size(), kMaxFilenameSize); |
331 RTC_CHECK_EQ(AudioProcessing::kNoError, | 336 RTC_CHECK_EQ(AudioProcessing::kNoError, |
332 ap_->StartDebugRecording( | 337 ap_->StartDebugRecording( |
333 settings_.aec_dump_output_filename->c_str(), -1)); | 338 settings_.aec_dump_output_filename->c_str(), -1)); |
334 } | 339 } |
335 } | 340 } |
336 | 341 |
337 } // namespace test | 342 } // namespace test |
338 } // namespace webrtc | 343 } // namespace webrtc |
OLD | NEW |