blob: dd9fc7073442ef016b7697e2ebe942dcb878dea7 [file] [log] [blame]
andrew@webrtc.org08df9b22014-12-16 20:57:15 +00001/*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Per Åhgren6ee75fd2019-04-26 11:33:37 +020011#include "modules/audio_processing/test/audioproc_float_impl.h"
12
Ivo Creusen2cb41052018-03-15 12:22:52 +010013#include <string.h>
14
aluebsb0ad43b2015-11-20 00:11:53 -080015#include <iostream>
kwiberg62eaacf2016-02-17 06:39:05 -080016#include <memory>
Ivo Creusen2cb41052018-03-15 12:22:52 +010017#include <string>
18#include <utility>
Alessio Bazzica68170382018-11-20 12:27:20 +010019#include <vector>
andrew@webrtc.org08df9b22014-12-16 20:57:15 +000020
Mirko Bonadei2ab97f62019-07-18 13:44:12 +020021#include "absl/flags/flag.h"
22#include "absl/flags/parse.h"
Alessio Bazzica68170382018-11-20 12:27:20 +010023#include "absl/strings/string_view.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020024#include "modules/audio_processing/include/audio_processing.h"
25#include "modules/audio_processing/test/aec_dump_based_simulator.h"
26#include "modules/audio_processing/test/audio_processing_simulator.h"
27#include "modules/audio_processing/test/wav_based_simulator.h"
Alessio Bazzica68170382018-11-20 12:27:20 +010028#include "rtc_base/checks.h"
Alessio Bazzica68170382018-11-20 12:27:20 +010029#include "rtc_base/strings/string_builder.h"
saza0cf99ce2020-04-01 17:42:01 +020030#include "system_wrappers/include/field_trial.h"
andrew@webrtc.org08df9b22014-12-16 20:57:15 +000031
Mirko Bonadei2ab97f62019-07-18 13:44:12 +020032constexpr int kParameterNotSpecifiedValue = -10000;
33
34ABSL_FLAG(std::string, dump_input, "", "Aec dump input filename");
35ABSL_FLAG(std::string, dump_output, "", "Aec dump output filename");
36ABSL_FLAG(std::string, i, "", "Forward stream input wav filename");
37ABSL_FLAG(std::string, o, "", "Forward stream output wav filename");
38ABSL_FLAG(std::string, ri, "", "Reverse stream input wav filename");
39ABSL_FLAG(std::string, ro, "", "Reverse stream output wav filename");
40ABSL_FLAG(std::string,
41 artificial_nearend,
42 "",
43 "Artificial nearend wav filename");
Per Åhgrenc20a19c2019-11-13 11:12:29 +010044ABSL_FLAG(std::string, linear_aec_output, "", "Linear AEC output wav filename");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +020045ABSL_FLAG(int,
46 output_num_channels,
47 kParameterNotSpecifiedValue,
48 "Number of forward stream output channels");
49ABSL_FLAG(int,
50 reverse_output_num_channels,
51 kParameterNotSpecifiedValue,
52 "Number of Reverse stream output channels");
53ABSL_FLAG(int,
54 output_sample_rate_hz,
55 kParameterNotSpecifiedValue,
56 "Forward stream output sample rate in Hz");
57ABSL_FLAG(int,
58 reverse_output_sample_rate_hz,
59 kParameterNotSpecifiedValue,
60 "Reverse stream output sample rate in Hz");
61ABSL_FLAG(bool,
62 fixed_interface,
63 false,
64 "Use the fixed interface when operating on wav files");
65ABSL_FLAG(int,
66 aec,
67 kParameterNotSpecifiedValue,
Gustaf Ullbergfdd60992021-03-15 14:26:40 +010068 "Activate (1) or deactivate (0) the echo canceller");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +020069ABSL_FLAG(int,
70 aecm,
71 kParameterNotSpecifiedValue,
Gustaf Ullbergfdd60992021-03-15 14:26:40 +010072 "Activate (1) or deactivate (0) the mobile echo controller");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +020073ABSL_FLAG(int,
74 ed,
75 kParameterNotSpecifiedValue,
76 "Activate (1) or deactivate (0) the residual echo detector");
77ABSL_FLAG(std::string,
78 ed_graph,
79 "",
80 "Output filename for graph of echo likelihood");
81ABSL_FLAG(int,
82 agc,
83 kParameterNotSpecifiedValue,
Gustaf Ullbergfdd60992021-03-15 14:26:40 +010084 "Activate (1) or deactivate (0) the AGC");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +020085ABSL_FLAG(int,
86 agc2,
87 kParameterNotSpecifiedValue,
Gustaf Ullbergfdd60992021-03-15 14:26:40 +010088 "Activate (1) or deactivate (0) the AGC2");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +020089ABSL_FLAG(int,
90 pre_amplifier,
91 kParameterNotSpecifiedValue,
Per Åhgrendb5d7282021-03-15 16:31:04 +000092 "Activate (1) or deactivate(0) the pre amplifier");
93ABSL_FLAG(
94 int,
95 capture_level_adjustment,
96 kParameterNotSpecifiedValue,
97 "Activate (1) or deactivate(0) the capture level adjustment functionality");
98ABSL_FLAG(int,
99 analog_mic_gain_emulation,
100 kParameterNotSpecifiedValue,
101 "Activate (1) or deactivate(0) the analog mic gain emulation in the "
102 "production (non-test) code.");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200103ABSL_FLAG(int,
104 hpf,
105 kParameterNotSpecifiedValue,
Gustaf Ullbergfdd60992021-03-15 14:26:40 +0100106 "Activate (1) or deactivate (0) the high-pass filter");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200107ABSL_FLAG(int,
108 ns,
109 kParameterNotSpecifiedValue,
Gustaf Ullbergfdd60992021-03-15 14:26:40 +0100110 "Activate (1) or deactivate (0) the noise suppressor");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200111ABSL_FLAG(int,
112 ts,
113 kParameterNotSpecifiedValue,
Alessio Bazzicabb986cb2022-03-17 17:19:17 +0100114 "Activate (1) or deactivate (0) the transient suppressor");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200115ABSL_FLAG(int,
Per Åhgren0695df12020-01-13 14:43:13 +0100116 analog_agc,
117 kParameterNotSpecifiedValue,
Gustaf Ullbergfdd60992021-03-15 14:26:40 +0100118 "Activate (1) or deactivate (0) the analog AGC");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200119ABSL_FLAG(bool,
120 all_default,
121 false,
122 "Activate all of the default components (will be overridden by any "
123 "other settings)");
124ABSL_FLAG(int,
Alessio Bazzica5cd7d2a2022-03-02 16:31:50 +0100125 analog_agc_use_digital_adaptive_controller,
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200126 kParameterNotSpecifiedValue,
Alessio Bazzica5cd7d2a2022-03-02 16:31:50 +0100127 "Activate (1) or deactivate (0) digital adaptation in AGC1. "
128 "Digital adaptation is active by default.");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200129ABSL_FLAG(int,
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200130 agc_mode,
131 kParameterNotSpecifiedValue,
132 "Specify the AGC mode (0-2)");
133ABSL_FLAG(int,
134 agc_target_level,
135 kParameterNotSpecifiedValue,
136 "Specify the AGC target level (0-31)");
137ABSL_FLAG(int,
138 agc_limiter,
139 kParameterNotSpecifiedValue,
Gustaf Ullbergfdd60992021-03-15 14:26:40 +0100140 "Activate (1) or deactivate (0) the level estimator");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200141ABSL_FLAG(int,
142 agc_compression_gain,
143 kParameterNotSpecifiedValue,
144 "Specify the AGC compression gain (0-90)");
145ABSL_FLAG(int,
146 agc2_enable_adaptive_gain,
147 kParameterNotSpecifiedValue,
Gustaf Ullbergfdd60992021-03-15 14:26:40 +0100148 "Activate (1) or deactivate (0) the AGC2 adaptive gain");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200149ABSL_FLAG(float,
150 agc2_fixed_gain_db,
151 kParameterNotSpecifiedValue,
152 "AGC2 fixed gain (dB) to apply");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200153ABSL_FLAG(float,
154 pre_amplifier_gain_factor,
155 kParameterNotSpecifiedValue,
156 "Pre-amplifier gain factor (linear) to apply");
Per Åhgrendb5d7282021-03-15 16:31:04 +0000157ABSL_FLAG(float,
158 pre_gain_factor,
159 kParameterNotSpecifiedValue,
160 "Pre-gain factor (linear) to apply in the capture level adjustment");
161ABSL_FLAG(float,
162 post_gain_factor,
163 kParameterNotSpecifiedValue,
164 "Post-gain factor (linear) to apply in the capture level adjustment");
165ABSL_FLAG(float,
166 analog_mic_gain_emulation_initial_level,
167 kParameterNotSpecifiedValue,
168 "Emulated analog mic level to apply initially in the production "
169 "(non-test) code.");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200170ABSL_FLAG(int,
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200171 ns_level,
172 kParameterNotSpecifiedValue,
173 "Specify the NS level (0-3)");
174ABSL_FLAG(int,
Per Åhgren2e8e1c62019-12-20 00:42:22 +0100175 ns_analysis_on_linear_aec_output,
176 kParameterNotSpecifiedValue,
177 "Specifies whether the noise suppression analysis is done on the "
178 "linear AEC output");
179ABSL_FLAG(int,
Per Åhgrenfcbe4072019-09-15 00:27:58 +0200180 maximum_internal_processing_rate,
181 kParameterNotSpecifiedValue,
182 "Set a maximum internal processing rate (32000 or 48000) to override "
183 "the default rate");
184ABSL_FLAG(int,
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200185 stream_delay,
186 kParameterNotSpecifiedValue,
187 "Specify the stream delay in ms to use");
188ABSL_FLAG(int,
189 use_stream_delay,
190 kParameterNotSpecifiedValue,
Gustaf Ullbergfdd60992021-03-15 14:26:40 +0100191 "Activate (1) or deactivate (0) reporting the stream delay");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200192ABSL_FLAG(int,
193 stream_drift_samples,
194 kParameterNotSpecifiedValue,
195 "Specify the number of stream drift samples to use");
Per Åhgrendb5d7282021-03-15 16:31:04 +0000196ABSL_FLAG(int,
197 initial_mic_level,
198 100,
199 "Initial mic level (0-255) for the analog mic gain simulation in the "
200 "test code");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200201ABSL_FLAG(int,
202 simulate_mic_gain,
203 0,
Per Åhgrendb5d7282021-03-15 16:31:04 +0000204 "Activate (1) or deactivate(0) the analog mic gain simulation in the "
205 "test code");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200206ABSL_FLAG(int,
Per Åhgrene14cb992019-11-27 09:34:22 +0100207 multi_channel_render,
Sam Zackrissonfeee1e42019-09-20 07:50:35 +0200208 kParameterNotSpecifiedValue,
Gustaf Ullbergfdd60992021-03-15 14:26:40 +0100209 "Activate (1) or deactivate (0) multi-channel render processing in "
Per Åhgrene14cb992019-11-27 09:34:22 +0100210 "APM pipeline");
211ABSL_FLAG(int,
212 multi_channel_capture,
213 kParameterNotSpecifiedValue,
Gustaf Ullbergfdd60992021-03-15 14:26:40 +0100214 "Activate (1) or deactivate (0) multi-channel capture processing in "
Per Åhgrene14cb992019-11-27 09:34:22 +0100215 "APM pipeline");
Sam Zackrissonfeee1e42019-09-20 07:50:35 +0200216ABSL_FLAG(int,
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200217 simulated_mic_kind,
218 kParameterNotSpecifiedValue,
219 "Specify which microphone kind to use for microphone simulation");
Per Åhgren34fdc922021-03-10 09:51:52 +0000220ABSL_FLAG(int,
Alessio Bazzicabb986cb2022-03-17 17:19:17 +0100221 override_key_pressed,
222 kParameterNotSpecifiedValue,
223 "Always set to true (1) or to false (0) the key press state. If "
224 "unspecified, false is set with Wav files or, with AEC dumps, the "
225 "recorded event is used.");
226ABSL_FLAG(int,
Per Åhgren34fdc922021-03-10 09:51:52 +0000227 frame_for_sending_capture_output_used_false,
228 kParameterNotSpecifiedValue,
229 "Capture frame index for sending a runtime setting for that the "
230 "capture output is not used.");
231ABSL_FLAG(int,
232 frame_for_sending_capture_output_used_true,
233 kParameterNotSpecifiedValue,
234 "Capture frame index for sending a runtime setting for that the "
235 "capture output is used.");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200236ABSL_FLAG(bool, performance_report, false, "Report the APM performance ");
237ABSL_FLAG(std::string,
238 performance_report_output_file,
239 "",
240 "Generate a CSV file with the API call durations");
241ABSL_FLAG(bool, verbose, false, "Produce verbose output");
242ABSL_FLAG(bool,
243 quiet,
244 false,
245 "Avoid producing information about the progress.");
246ABSL_FLAG(bool,
247 bitexactness_report,
248 false,
249 "Report bitexactness for aec dump result reproduction");
250ABSL_FLAG(bool,
251 discard_settings_in_aecdump,
252 false,
253 "Discard any config settings specified in the aec dump");
254ABSL_FLAG(bool,
255 store_intermediate_output,
256 false,
257 "Creates new output files after each init");
258ABSL_FLAG(std::string,
259 custom_call_order_file,
260 "",
261 "Custom process API call order file");
262ABSL_FLAG(std::string,
263 output_custom_call_order_file,
264 "",
265 "Generate custom process API call order file from AEC dump");
266ABSL_FLAG(bool,
267 print_aec_parameter_values,
268 false,
269 "Print parameter values used in AEC in JSON-format");
270ABSL_FLAG(std::string,
271 aec_settings,
272 "",
273 "File in JSON-format with custom AEC settings");
274ABSL_FLAG(bool,
275 dump_data,
276 false,
277 "Dump internal data during the call (requires build flag)");
278ABSL_FLAG(std::string,
279 dump_data_output_dir,
280 "",
281 "Internal data dump output directory");
Per Åhgrenc2ae4c82021-01-20 15:42:13 +0100282ABSL_FLAG(int,
283 dump_set_to_use,
284 kParameterNotSpecifiedValue,
285 "Specifies the dump set to use (if not all the dump sets will "
286 "be used");
Per Åhgren5dca3f12020-01-28 09:08:11 +0100287ABSL_FLAG(bool,
Per Åhgren879d33b2021-01-21 10:08:15 +0100288 analyze,
289 false,
290 "Only analyze the call setup behavior (no processing)");
291ABSL_FLAG(float,
292 dump_start_seconds,
293 kParameterNotSpecifiedValue,
294 "Start of when to dump data (seconds).");
295ABSL_FLAG(float,
296 dump_end_seconds,
297 kParameterNotSpecifiedValue,
298 "End of when to dump data (seconds).");
299ABSL_FLAG(int,
300 dump_start_frame,
301 kParameterNotSpecifiedValue,
302 "Start of when to dump data (frames).");
303ABSL_FLAG(int,
304 dump_end_frame,
305 kParameterNotSpecifiedValue,
306 "End of when to dump data (frames).");
307ABSL_FLAG(int,
308 init_to_process,
309 kParameterNotSpecifiedValue,
310 "Init index to process.");
311
312ABSL_FLAG(bool,
Per Åhgren5dca3f12020-01-28 09:08:11 +0100313 float_wav_output,
314 false,
315 "Produce floating point wav output files.");
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200316
saza0cf99ce2020-04-01 17:42:01 +0200317ABSL_FLAG(std::string,
318 force_fieldtrials,
319 "",
320 "Field trials control experimental feature code which can be forced. "
321 "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enable/"
322 " will assign the group Enable to field trial WebRTC-FooFeature.");
323
peah60a189f2016-05-24 20:54:40 -0700324namespace webrtc {
325namespace test {
Peter Kasting69558702016-01-12 16:26:35 -0800326namespace {
327
peah60a189f2016-05-24 20:54:40 -0700328const char kUsageDescription[] =
329 "Usage: audioproc_f [options] -i <input.wav>\n"
330 " or\n"
331 " audioproc_f [options] -dump_input <aec_dump>\n"
332 "\n\n"
333 "Command-line tool to simulate a call using the audio "
334 "processing module, either based on wav files or "
oprypin6e09d872017-08-31 03:21:39 -0700335 "protobuf debug dump recordings.\n";
peah60a189f2016-05-24 20:54:40 -0700336
Ali Tofighf3592cb2022-08-16 14:44:38 +0200337void SetSettingIfSpecified(absl::string_view value,
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200338 absl::optional<std::string>* parameter) {
peah60a189f2016-05-24 20:54:40 -0700339 if (value.compare("") != 0) {
Ali Tofighf3592cb2022-08-16 14:44:38 +0200340 *parameter = std::string(value);
peah60a189f2016-05-24 20:54:40 -0700341 }
342}
343
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200344void SetSettingIfSpecified(int value, absl::optional<int>* parameter) {
peah60a189f2016-05-24 20:54:40 -0700345 if (value != kParameterNotSpecifiedValue) {
Oskar Sundbomaa8b67d2017-11-17 14:34:48 +0100346 *parameter = value;
peah60a189f2016-05-24 20:54:40 -0700347 }
348}
349
Per Åhgrenef349602019-04-12 16:26:34 +0200350void SetSettingIfSpecified(float value, absl::optional<float>* parameter) {
351 constexpr float kFloatParameterNotSpecifiedValue =
352 kParameterNotSpecifiedValue;
353 if (value != kFloatParameterNotSpecifiedValue) {
354 *parameter = value;
355 }
356}
357
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200358void SetSettingIfFlagSet(int32_t flag, absl::optional<bool>* parameter) {
peah60a189f2016-05-24 20:54:40 -0700359 if (flag == 0) {
Oskar Sundbomaa8b67d2017-11-17 14:34:48 +0100360 *parameter = false;
peah60a189f2016-05-24 20:54:40 -0700361 } else if (flag == 1) {
Oskar Sundbomaa8b67d2017-11-17 14:34:48 +0100362 *parameter = true;
peah60a189f2016-05-24 20:54:40 -0700363 }
364}
365
366SimulationSettings CreateSettings() {
367 SimulationSettings settings;
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200368 if (absl::GetFlag(FLAGS_all_default)) {
Oskar Sundbomaa8b67d2017-11-17 14:34:48 +0100369 settings.use_ts = true;
Per Åhgren0695df12020-01-13 14:43:13 +0100370 settings.use_analog_agc = true;
Oskar Sundbomaa8b67d2017-11-17 14:34:48 +0100371 settings.use_ns = true;
372 settings.use_hpf = true;
373 settings.use_agc = true;
374 settings.use_agc2 = false;
Alex Loiko5feb30e2018-04-16 13:52:32 +0200375 settings.use_pre_amplifier = false;
Oskar Sundbomaa8b67d2017-11-17 14:34:48 +0100376 settings.use_aec = true;
377 settings.use_aecm = false;
378 settings.use_ed = false;
peah60a189f2016-05-24 20:54:40 -0700379 }
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200380 SetSettingIfSpecified(absl::GetFlag(FLAGS_dump_input),
381 &settings.aec_dump_input_filename);
382 SetSettingIfSpecified(absl::GetFlag(FLAGS_dump_output),
383 &settings.aec_dump_output_filename);
384 SetSettingIfSpecified(absl::GetFlag(FLAGS_i), &settings.input_filename);
385 SetSettingIfSpecified(absl::GetFlag(FLAGS_o), &settings.output_filename);
386 SetSettingIfSpecified(absl::GetFlag(FLAGS_ri),
387 &settings.reverse_input_filename);
388 SetSettingIfSpecified(absl::GetFlag(FLAGS_ro),
389 &settings.reverse_output_filename);
390 SetSettingIfSpecified(absl::GetFlag(FLAGS_artificial_nearend),
peahdf80fd12016-12-09 02:43:40 -0800391 &settings.artificial_nearend_filename);
Per Åhgrenc20a19c2019-11-13 11:12:29 +0100392 SetSettingIfSpecified(absl::GetFlag(FLAGS_linear_aec_output),
393 &settings.linear_aec_output_filename);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200394 SetSettingIfSpecified(absl::GetFlag(FLAGS_output_num_channels),
peah60a189f2016-05-24 20:54:40 -0700395 &settings.output_num_channels);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200396 SetSettingIfSpecified(absl::GetFlag(FLAGS_reverse_output_num_channels),
peah60a189f2016-05-24 20:54:40 -0700397 &settings.reverse_output_num_channels);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200398 SetSettingIfSpecified(absl::GetFlag(FLAGS_output_sample_rate_hz),
peah60a189f2016-05-24 20:54:40 -0700399 &settings.output_sample_rate_hz);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200400 SetSettingIfSpecified(absl::GetFlag(FLAGS_reverse_output_sample_rate_hz),
peah60a189f2016-05-24 20:54:40 -0700401 &settings.reverse_output_sample_rate_hz);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200402 SetSettingIfFlagSet(absl::GetFlag(FLAGS_aec), &settings.use_aec);
403 SetSettingIfFlagSet(absl::GetFlag(FLAGS_aecm), &settings.use_aecm);
404 SetSettingIfFlagSet(absl::GetFlag(FLAGS_ed), &settings.use_ed);
405 SetSettingIfSpecified(absl::GetFlag(FLAGS_ed_graph),
406 &settings.ed_graph_output_filename);
407 SetSettingIfFlagSet(absl::GetFlag(FLAGS_agc), &settings.use_agc);
408 SetSettingIfFlagSet(absl::GetFlag(FLAGS_agc2), &settings.use_agc2);
409 SetSettingIfFlagSet(absl::GetFlag(FLAGS_pre_amplifier),
410 &settings.use_pre_amplifier);
Per Åhgrendb5d7282021-03-15 16:31:04 +0000411 SetSettingIfFlagSet(absl::GetFlag(FLAGS_capture_level_adjustment),
412 &settings.use_capture_level_adjustment);
413 SetSettingIfFlagSet(absl::GetFlag(FLAGS_analog_mic_gain_emulation),
414 &settings.use_analog_mic_gain_emulation);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200415 SetSettingIfFlagSet(absl::GetFlag(FLAGS_hpf), &settings.use_hpf);
416 SetSettingIfFlagSet(absl::GetFlag(FLAGS_ns), &settings.use_ns);
Gustaf Ullbergfdd60992021-03-15 14:26:40 +0100417 SetSettingIfSpecified(absl::GetFlag(FLAGS_ts), &settings.use_ts);
Per Åhgren0695df12020-01-13 14:43:13 +0100418 SetSettingIfFlagSet(absl::GetFlag(FLAGS_analog_agc),
419 &settings.use_analog_agc);
Alessio Bazzica5cd7d2a2022-03-02 16:31:50 +0100420 SetSettingIfFlagSet(
421 absl::GetFlag(FLAGS_analog_agc_use_digital_adaptive_controller),
422 &settings.analog_agc_use_digital_adaptive_controller);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200423 SetSettingIfSpecified(absl::GetFlag(FLAGS_agc_mode), &settings.agc_mode);
424 SetSettingIfSpecified(absl::GetFlag(FLAGS_agc_target_level),
425 &settings.agc_target_level);
426 SetSettingIfFlagSet(absl::GetFlag(FLAGS_agc_limiter),
427 &settings.use_agc_limiter);
428 SetSettingIfSpecified(absl::GetFlag(FLAGS_agc_compression_gain),
peah60a189f2016-05-24 20:54:40 -0700429 &settings.agc_compression_gain);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200430 SetSettingIfFlagSet(absl::GetFlag(FLAGS_agc2_enable_adaptive_gain),
Per Åhgrene4d23b12018-10-02 23:40:07 +0200431 &settings.agc2_use_adaptive_gain);
Per Åhgren879d33b2021-01-21 10:08:15 +0100432
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200433 SetSettingIfSpecified(absl::GetFlag(FLAGS_agc2_fixed_gain_db),
434 &settings.agc2_fixed_gain_db);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200435 SetSettingIfSpecified(absl::GetFlag(FLAGS_pre_amplifier_gain_factor),
Per Åhgrenef349602019-04-12 16:26:34 +0200436 &settings.pre_amplifier_gain_factor);
Per Åhgrendb5d7282021-03-15 16:31:04 +0000437 SetSettingIfSpecified(absl::GetFlag(FLAGS_pre_gain_factor),
438 &settings.pre_gain_factor);
439 SetSettingIfSpecified(absl::GetFlag(FLAGS_post_gain_factor),
440 &settings.post_gain_factor);
441 SetSettingIfSpecified(
442 absl::GetFlag(FLAGS_analog_mic_gain_emulation_initial_level),
443 &settings.analog_mic_gain_emulation_initial_level);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200444 SetSettingIfSpecified(absl::GetFlag(FLAGS_ns_level), &settings.ns_level);
Per Åhgren2e8e1c62019-12-20 00:42:22 +0100445 SetSettingIfFlagSet(absl::GetFlag(FLAGS_ns_analysis_on_linear_aec_output),
446 &settings.ns_analysis_on_linear_aec_output);
Per Åhgrenfcbe4072019-09-15 00:27:58 +0200447 SetSettingIfSpecified(absl::GetFlag(FLAGS_maximum_internal_processing_rate),
448 &settings.maximum_internal_processing_rate);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200449 SetSettingIfSpecified(absl::GetFlag(FLAGS_stream_delay),
450 &settings.stream_delay);
451 SetSettingIfFlagSet(absl::GetFlag(FLAGS_use_stream_delay),
452 &settings.use_stream_delay);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200453 SetSettingIfSpecified(absl::GetFlag(FLAGS_custom_call_order_file),
Ivo Creusen9a66d5e2019-03-13 13:55:12 +0100454 &settings.call_order_input_filename);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200455 SetSettingIfSpecified(absl::GetFlag(FLAGS_output_custom_call_order_file),
Ivo Creusen9a66d5e2019-03-13 13:55:12 +0100456 &settings.call_order_output_filename);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200457 SetSettingIfSpecified(absl::GetFlag(FLAGS_aec_settings),
458 &settings.aec_settings_filename);
459 settings.initial_mic_level = absl::GetFlag(FLAGS_initial_mic_level);
Per Åhgrene14cb992019-11-27 09:34:22 +0100460 SetSettingIfFlagSet(absl::GetFlag(FLAGS_multi_channel_render),
461 &settings.multi_channel_render);
462 SetSettingIfFlagSet(absl::GetFlag(FLAGS_multi_channel_capture),
463 &settings.multi_channel_capture);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200464 settings.simulate_mic_gain = absl::GetFlag(FLAGS_simulate_mic_gain);
465 SetSettingIfSpecified(absl::GetFlag(FLAGS_simulated_mic_kind),
466 &settings.simulated_mic_kind);
Alessio Bazzicabb986cb2022-03-17 17:19:17 +0100467 SetSettingIfFlagSet(absl::GetFlag(FLAGS_override_key_pressed),
468 &settings.override_key_pressed);
Per Åhgren34fdc922021-03-10 09:51:52 +0000469 SetSettingIfSpecified(
470 absl::GetFlag(FLAGS_frame_for_sending_capture_output_used_false),
471 &settings.frame_for_sending_capture_output_used_false);
472 SetSettingIfSpecified(
473 absl::GetFlag(FLAGS_frame_for_sending_capture_output_used_true),
474 &settings.frame_for_sending_capture_output_used_true);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200475 settings.report_performance = absl::GetFlag(FLAGS_performance_report);
476 SetSettingIfSpecified(absl::GetFlag(FLAGS_performance_report_output_file),
Per Åhgrenada9b892019-04-03 16:06:42 +0200477 &settings.performance_report_output_filename);
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200478 settings.use_verbose_logging = absl::GetFlag(FLAGS_verbose);
479 settings.use_quiet_output = absl::GetFlag(FLAGS_quiet);
480 settings.report_bitexactness = absl::GetFlag(FLAGS_bitexactness_report);
481 settings.discard_all_settings_in_aecdump =
482 absl::GetFlag(FLAGS_discard_settings_in_aecdump);
483 settings.fixed_interface = absl::GetFlag(FLAGS_fixed_interface);
484 settings.store_intermediate_output =
485 absl::GetFlag(FLAGS_store_intermediate_output);
486 settings.print_aec_parameter_values =
487 absl::GetFlag(FLAGS_print_aec_parameter_values);
488 settings.dump_internal_data = absl::GetFlag(FLAGS_dump_data);
489 SetSettingIfSpecified(absl::GetFlag(FLAGS_dump_data_output_dir),
Alessio Bazzica4bc60452018-11-20 12:44:15 +0100490 &settings.dump_internal_data_output_dir);
Per Åhgrenc2ae4c82021-01-20 15:42:13 +0100491 SetSettingIfSpecified(absl::GetFlag(FLAGS_dump_set_to_use),
492 &settings.dump_set_to_use);
Per Åhgren5dca3f12020-01-28 09:08:11 +0100493 settings.wav_output_format = absl::GetFlag(FLAGS_float_wav_output)
494 ? WavFile::SampleFormat::kFloat
495 : WavFile::SampleFormat::kInt16;
peah60a189f2016-05-24 20:54:40 -0700496
Per Åhgren879d33b2021-01-21 10:08:15 +0100497 settings.analysis_only = absl::GetFlag(FLAGS_analyze);
498
499 SetSettingIfSpecified(absl::GetFlag(FLAGS_dump_start_frame),
500 &settings.dump_start_frame);
501 SetSettingIfSpecified(absl::GetFlag(FLAGS_dump_end_frame),
502 &settings.dump_end_frame);
503
504 constexpr int kFramesPerSecond = 100;
505 absl::optional<float> start_seconds;
506 SetSettingIfSpecified(absl::GetFlag(FLAGS_dump_start_seconds),
507 &start_seconds);
508 if (start_seconds) {
509 settings.dump_start_frame = *start_seconds * kFramesPerSecond;
510 }
511
512 absl::optional<float> end_seconds;
513 SetSettingIfSpecified(absl::GetFlag(FLAGS_dump_end_seconds), &end_seconds);
514 if (end_seconds) {
515 settings.dump_end_frame = *end_seconds * kFramesPerSecond;
516 }
517
518 SetSettingIfSpecified(absl::GetFlag(FLAGS_init_to_process),
519 &settings.init_to_process);
520
peah60a189f2016-05-24 20:54:40 -0700521 return settings;
522}
523
Ali Tofighf3592cb2022-08-16 14:44:38 +0200524void ReportConditionalErrorAndExit(bool condition, absl::string_view message) {
peah60a189f2016-05-24 20:54:40 -0700525 if (condition) {
526 std::cerr << message << std::endl;
527 exit(1);
528 }
529}
530
Per Åhgrene9cd6172020-05-19 12:52:08 +0200531void PerformBasicParameterSanityChecks(
532 const SimulationSettings& settings,
533 bool pre_constructed_ap_provided,
534 bool pre_constructed_ap_builder_provided) {
peah60a189f2016-05-24 20:54:40 -0700535 if (settings.input_filename || settings.reverse_input_filename) {
Sonia-Florina Horchidanb75d14c2019-08-12 09:57:01 +0200536 ReportConditionalErrorAndExit(
537 !!settings.aec_dump_input_filename,
538 "Error: The aec dump file cannot be specified "
539 "together with input wav files!\n");
540
541 ReportConditionalErrorAndExit(
542 !!settings.aec_dump_input_string,
543 "Error: The aec dump input string cannot be specified "
544 "together with input wav files!\n");
peah60a189f2016-05-24 20:54:40 -0700545
peahdf80fd12016-12-09 02:43:40 -0800546 ReportConditionalErrorAndExit(!!settings.artificial_nearend_filename,
547 "Error: The artificial nearend cannot be "
548 "specified together with input wav files!\n");
549
peah60a189f2016-05-24 20:54:40 -0700550 ReportConditionalErrorAndExit(!settings.input_filename,
551 "Error: When operating at wav files, the "
552 "input wav filename must be "
553 "specified!\n");
554
555 ReportConditionalErrorAndExit(
556 settings.reverse_output_filename && !settings.reverse_input_filename,
557 "Error: When operating at wav files, the reverse input wav filename "
558 "must be specified if the reverse output wav filename is specified!\n");
559 } else {
Sonia-Florina Horchidanb75d14c2019-08-12 09:57:01 +0200560 ReportConditionalErrorAndExit(
561 !settings.aec_dump_input_filename && !settings.aec_dump_input_string,
562 "Error: Either the aec dump input file, the wav "
563 "input file or the aec dump input string must be specified!\n");
564 ReportConditionalErrorAndExit(
565 settings.aec_dump_input_filename && settings.aec_dump_input_string,
566 "Error: The aec dump input file cannot be specified together with the "
567 "aec dump input string!\n");
peah60a189f2016-05-24 20:54:40 -0700568 }
569
Per Åhgrenc20a19c2019-11-13 11:12:29 +0100570 ReportConditionalErrorAndExit(settings.use_aec && !(*settings.use_aec) &&
571 settings.linear_aec_output_filename,
572 "Error: The linear AEC ouput filename cannot "
573 "be specified without the AEC being active");
574
575 ReportConditionalErrorAndExit(
peah60a189f2016-05-24 20:54:40 -0700576 settings.use_aec && *settings.use_aec && settings.use_aecm &&
577 *settings.use_aecm,
578 "Error: The AEC and the AECM cannot be activated at the same time!\n");
579
580 ReportConditionalErrorAndExit(
581 settings.output_sample_rate_hz && *settings.output_sample_rate_hz <= 0,
582 "Error: --output_sample_rate_hz must be positive!\n");
583
584 ReportConditionalErrorAndExit(
585 settings.reverse_output_sample_rate_hz &&
586 settings.output_sample_rate_hz &&
587 *settings.output_sample_rate_hz <= 0,
588 "Error: --reverse_output_sample_rate_hz must be positive!\n");
589
590 ReportConditionalErrorAndExit(
591 settings.output_num_channels && *settings.output_num_channels <= 0,
592 "Error: --output_num_channels must be positive!\n");
593
594 ReportConditionalErrorAndExit(
595 settings.reverse_output_num_channels &&
596 *settings.reverse_output_num_channels <= 0,
597 "Error: --reverse_output_num_channels must be positive!\n");
598
peah60a189f2016-05-24 20:54:40 -0700599 ReportConditionalErrorAndExit(
peah60a189f2016-05-24 20:54:40 -0700600 settings.agc_target_level && ((*settings.agc_target_level) < 0 ||
601 (*settings.agc_target_level) > 31),
602 "Error: --agc_target_level must be specified between 0 and 31.\n");
603
604 ReportConditionalErrorAndExit(
605 settings.agc_compression_gain && ((*settings.agc_compression_gain) < 0 ||
606 (*settings.agc_compression_gain) > 90),
607 "Error: --agc_compression_gain must be specified between 0 and 90.\n");
608
609 ReportConditionalErrorAndExit(
Per Åhgren6ee75fd2019-04-26 11:33:37 +0200610 settings.agc2_fixed_gain_db && ((*settings.agc2_fixed_gain_db) < 0 ||
611 (*settings.agc2_fixed_gain_db) > 90),
Alessio Bazzica270f7b52017-10-13 11:05:17 +0200612 "Error: --agc2_fixed_gain_db must be specified between 0 and 90.\n");
613
614 ReportConditionalErrorAndExit(
peah60a189f2016-05-24 20:54:40 -0700615 settings.ns_level &&
616 ((*settings.ns_level) < 0 || (*settings.ns_level) > 3),
617 "Error: --ns_level must be specified between 0 and 3.\n");
618
619 ReportConditionalErrorAndExit(
620 settings.report_bitexactness && !settings.aec_dump_input_filename,
621 "Error: --bitexactness_report can only be used when operating on an "
622 "aecdump\n");
623
peah5ad5de32016-12-09 03:18:22 -0800624 ReportConditionalErrorAndExit(
Ivo Creusen9a66d5e2019-03-13 13:55:12 +0100625 settings.call_order_input_filename && settings.aec_dump_input_filename,
peah5ad5de32016-12-09 03:18:22 -0800626 "Error: --custom_call_order_file cannot be used when operating on an "
627 "aecdump\n");
628
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200629 ReportConditionalErrorAndExit(
630 (settings.initial_mic_level < 0 || settings.initial_mic_level > 255),
631 "Error: --initial_mic_level must be specified between 0 and 255.\n");
632
633 ReportConditionalErrorAndExit(
634 settings.simulated_mic_kind && !settings.simulate_mic_gain,
635 "Error: --simulated_mic_kind cannot be specified when mic simulation is "
636 "disabled\n");
637
638 ReportConditionalErrorAndExit(
639 !settings.simulated_mic_kind && settings.simulate_mic_gain,
640 "Error: --simulated_mic_kind must be specified when mic simulation is "
641 "enabled\n");
642
Ali Tofighf3592cb2022-08-16 14:44:38 +0200643 auto valid_wav_name = [](absl::string_view wav_file_name) {
peah60a189f2016-05-24 20:54:40 -0700644 if (wav_file_name.size() < 5) {
645 return false;
646 }
647 if ((wav_file_name.compare(wav_file_name.size() - 4, 4, ".wav") == 0) ||
648 (wav_file_name.compare(wav_file_name.size() - 4, 4, ".WAV") == 0)) {
649 return true;
650 }
651 return false;
652 };
653
654 ReportConditionalErrorAndExit(
655 settings.input_filename && (!valid_wav_name(*settings.input_filename)),
656 "Error: --i must be a valid .wav file name.\n");
657
658 ReportConditionalErrorAndExit(
659 settings.output_filename && (!valid_wav_name(*settings.output_filename)),
660 "Error: --o must be a valid .wav file name.\n");
661
662 ReportConditionalErrorAndExit(
663 settings.reverse_input_filename &&
664 (!valid_wav_name(*settings.reverse_input_filename)),
665 "Error: --ri must be a valid .wav file name.\n");
666
667 ReportConditionalErrorAndExit(
668 settings.reverse_output_filename &&
669 (!valid_wav_name(*settings.reverse_output_filename)),
670 "Error: --ro must be a valid .wav file name.\n");
peahdf80fd12016-12-09 02:43:40 -0800671
672 ReportConditionalErrorAndExit(
673 settings.artificial_nearend_filename &&
674 !valid_wav_name(*settings.artificial_nearend_filename),
675 "Error: --artifical_nearend must be a valid .wav file name.\n");
Per Åhgren7a95e0f2018-10-25 09:56:49 +0200676
677 ReportConditionalErrorAndExit(
Per Åhgrenc20a19c2019-11-13 11:12:29 +0100678 settings.linear_aec_output_filename &&
679 (!valid_wav_name(*settings.linear_aec_output_filename)),
680 "Error: --linear_aec_output must be a valid .wav file name.\n");
681
682 ReportConditionalErrorAndExit(
Per Åhgren7a95e0f2018-10-25 09:56:49 +0200683 WEBRTC_APM_DEBUG_DUMP == 0 && settings.dump_internal_data,
684 "Error: --dump_data cannot be set without proper build support.\n");
Alessio Bazzica4bc60452018-11-20 12:44:15 +0100685
Per Åhgren879d33b2021-01-21 10:08:15 +0100686 ReportConditionalErrorAndExit(settings.init_to_process &&
687 *settings.init_to_process != 1 &&
688 !settings.aec_dump_input_filename,
689 "Error: --init_to_process must be set to 1 for "
690 "wav-file based simulations.\n");
691
692 ReportConditionalErrorAndExit(
693 !settings.init_to_process &&
694 (settings.dump_start_frame || settings.dump_end_frame),
695 "Error: --init_to_process must be set when specifying a start and/or end "
696 "frame for when to dump internal data.\n");
697
Alessio Bazzica4bc60452018-11-20 12:44:15 +0100698 ReportConditionalErrorAndExit(
699 !settings.dump_internal_data &&
700 settings.dump_internal_data_output_dir.has_value(),
701 "Error: --dump_data_output_dir cannot be set without --dump_data.\n");
Ivo Creusen9a66d5e2019-03-13 13:55:12 +0100702
703 ReportConditionalErrorAndExit(
704 !settings.aec_dump_input_filename &&
705 settings.call_order_output_filename.has_value(),
706 "Error: --output_custom_call_order_file needs an AEC dump input file.\n");
Per Åhgrenef349602019-04-12 16:26:34 +0200707
708 ReportConditionalErrorAndExit(
709 (!settings.use_pre_amplifier || !(*settings.use_pre_amplifier)) &&
710 settings.pre_amplifier_gain_factor.has_value(),
711 "Error: --pre_amplifier_gain_factor needs --pre_amplifier to be "
712 "specified and set.\n");
Per Åhgrene9cd6172020-05-19 12:52:08 +0200713
714 ReportConditionalErrorAndExit(
715 pre_constructed_ap_provided && pre_constructed_ap_builder_provided,
716 "Error: The AudioProcessing and the AudioProcessingBuilder cannot both "
717 "be specified at the same time.\n");
718
719 ReportConditionalErrorAndExit(
720 settings.aec_settings_filename && pre_constructed_ap_provided,
721 "Error: The aec_settings_filename cannot be specified when a "
722 "pre-constructed audio processing object is provided.\n");
723
724 ReportConditionalErrorAndExit(
725 settings.aec_settings_filename && pre_constructed_ap_provided,
726 "Error: The print_aec_parameter_values cannot be set when a "
727 "pre-constructed audio processing object is provided.\n");
728
729 if (settings.linear_aec_output_filename && pre_constructed_ap_provided) {
730 std::cout << "Warning: For the linear AEC output to be stored, this must "
731 "be configured in the AEC that is part of the provided "
732 "AudioProcessing object."
733 << std::endl;
734 }
Peter Kasting69558702016-01-12 16:26:35 -0800735}
736
Per Åhgrene9cd6172020-05-19 12:52:08 +0200737int RunSimulation(rtc::scoped_refptr<AudioProcessing> audio_processing,
738 std::unique_ptr<AudioProcessingBuilder> ap_builder,
739 int argc,
740 char* argv[],
741 absl::string_view input_aecdump,
742 std::vector<float>* processed_capture_samples) {
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200743 std::vector<char*> args = absl::ParseCommandLine(argc, argv);
744 if (args.size() != 1) {
oprypin6e09d872017-08-31 03:21:39 -0700745 printf("%s", kUsageDescription);
oprypin6e09d872017-08-31 03:21:39 -0700746 return 1;
747 }
saza0cf99ce2020-04-01 17:42:01 +0200748 // InitFieldTrialsFromString stores the char*, so the char array must
749 // outlive the application.
750 const std::string field_trials = absl::GetFlag(FLAGS_force_fieldtrials);
751 webrtc::field_trial::InitFieldTrialsFromString(field_trials.c_str());
752
peah60a189f2016-05-24 20:54:40 -0700753 SimulationSettings settings = CreateSettings();
Sonia-Florina Horchidanb75d14c2019-08-12 09:57:01 +0200754 if (!input_aecdump.empty()) {
755 settings.aec_dump_input_string = input_aecdump;
756 settings.processed_capture_samples = processed_capture_samples;
757 RTC_CHECK(settings.processed_capture_samples);
758 }
Per Åhgrene9cd6172020-05-19 12:52:08 +0200759 PerformBasicParameterSanityChecks(settings, !!audio_processing, !!ap_builder);
peah60a189f2016-05-24 20:54:40 -0700760 std::unique_ptr<AudioProcessingSimulator> processor;
andrew@webrtc.org08df9b22014-12-16 20:57:15 +0000761
Sonia-Florina Horchidanb75d14c2019-08-12 09:57:01 +0200762 if (settings.aec_dump_input_filename || settings.aec_dump_input_string) {
Per Åhgrene9cd6172020-05-19 12:52:08 +0200763 processor.reset(new AecDumpBasedSimulator(
764 settings, std::move(audio_processing), std::move(ap_builder)));
aluebsb0ad43b2015-11-20 00:11:53 -0800765 } else {
Per Åhgrene9cd6172020-05-19 12:52:08 +0200766 processor.reset(new WavBasedSimulator(settings, std::move(audio_processing),
767 std::move(ap_builder)));
andrewbdafe312015-10-29 23:42:54 -0700768 }
769
Per Åhgren879d33b2021-01-21 10:08:15 +0100770 if (settings.analysis_only) {
771 processor->Analyze();
772 } else {
773 processor->Process();
774 }
aluebsb0ad43b2015-11-20 00:11:53 -0800775
peah60a189f2016-05-24 20:54:40 -0700776 if (settings.report_performance) {
Per Åhgrenada9b892019-04-03 16:06:42 +0200777 processor->GetApiCallStatistics().PrintReport();
778 }
779 if (settings.performance_report_output_filename) {
780 processor->GetApiCallStatistics().WriteReportToFile(
781 *settings.performance_report_output_filename);
peah60a189f2016-05-24 20:54:40 -0700782 }
783
784 if (settings.report_bitexactness && settings.aec_dump_input_filename) {
785 if (processor->OutputWasBitexact()) {
786 std::cout << "The processing was bitexact.";
787 } else {
788 std::cout << "The processing was not bitexact.";
789 }
Alejandro Luebs5d22c002015-04-15 11:26:40 -0700790 }
aluebsb0ad43b2015-11-20 00:11:53 -0800791
andrew@webrtc.org08df9b22014-12-16 20:57:15 +0000792 return 0;
793}
794
Per Åhgrene9cd6172020-05-19 12:52:08 +0200795} // namespace
796
797int AudioprocFloatImpl(rtc::scoped_refptr<AudioProcessing> audio_processing,
798 int argc,
799 char* argv[]) {
800 return RunSimulation(
801 std::move(audio_processing), /*ap_builder=*/nullptr, argc, argv,
802 /*input_aecdump=*/"", /*processed_capture_samples=*/nullptr);
803}
804
805int AudioprocFloatImpl(std::unique_ptr<AudioProcessingBuilder> ap_builder,
806 int argc,
807 char* argv[],
808 absl::string_view input_aecdump,
809 std::vector<float>* processed_capture_samples) {
810 return RunSimulation(/*audio_processing=*/nullptr, std::move(ap_builder),
811 argc, argv, input_aecdump, processed_capture_samples);
812}
813
peah60a189f2016-05-24 20:54:40 -0700814} // namespace test
andrew@webrtc.org08df9b22014-12-16 20:57:15 +0000815} // namespace webrtc