Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Unified Diff: webrtc/modules/audio_processing/test/audioproc_float.cc

Issue 2846853002: audioproc_f with fake microphone. (Closed)
Patch Set: Initialized FakeRecordingDevice, added 'kind' command line flag, fixed bugs. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/test/audioproc_float.cc
diff --git a/webrtc/modules/audio_processing/test/audioproc_float.cc b/webrtc/modules/audio_processing/test/audioproc_float.cc
index 46e294086a6c8fad4fe513d17d0f8bbdc129f2c7..c34a64977b6b75d6988e728c55488a832029b785 100644
--- a/webrtc/modules/audio_processing/test/audioproc_float.cc
+++ b/webrtc/modules/audio_processing/test/audioproc_float.cc
@@ -161,6 +161,9 @@ DEFINE_int32(stream_drift_samples,
DEFINE_bool(simulate_mic_gain,
false,
"Simulate adjustable microphone analog gain");
+DEFINE_int32(simulated_mic_kind,
+ kParameterNotSpecifiedValue,
+ "Specify which microphone kind to use for microphone simulation");
DEFINE_bool(performance_report, false, "Report the APM performance ");
DEFINE_bool(verbose, false, "Produce verbose output");
DEFINE_bool(bitexactness_report,
@@ -268,6 +271,7 @@ SimulationSettings CreateSettings() {
SetSettingIfSpecified(FLAGS_custom_call_order_file,
&settings.custom_call_order_filename);
settings.simulate_mic_gain = FLAGS_simulate_mic_gain;
+ SetSettingIfSpecified(FLAGS_simulated_mic_kind, &settings.simulated_mic_kind);
settings.report_performance = FLAGS_performance_report;
settings.use_verbose_logging = FLAGS_verbose;
settings.report_bitexactness = FLAGS_bitexactness_report;
@@ -384,6 +388,16 @@ void PerformBasicParameterSanityChecks(const SimulationSettings& settings) {
"Error: --custom_call_order_file cannot be used when operating on an "
"aecdump\n");
+ ReportConditionalErrorAndExit(
+ settings.simulated_mic_kind && !settings.simulate_mic_gain,
+ "Error: --simulated_mic_kind cannot be specified mic simulation is "
+ "disabled\n");
+
+ ReportConditionalErrorAndExit(
+ !settings.simulated_mic_kind && settings.simulate_mic_gain,
+ "Error: --simulated_mic_kind must be specified when mic simulation is "
+ "enabled\n");
+
auto valid_wav_name = [](const std::string& wav_file_name) {
if (wav_file_name.size() < 5) {
return false;

Powered by Google App Engine
This is Rietveld 408576698