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

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

Issue 2834643002: audioproc_f with simulated mic analog gain (Closed)
Patch Set: AEC dump + fake rec device bugfix Created 3 years, 3 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 a11f41c855183c371c454ecc1b0d24d343b7e595..4e0aa718e8355a486eefb97fc8103d4a4734372a 100644
--- a/webrtc/modules/audio_processing/test/audioproc_float.cc
+++ b/webrtc/modules/audio_processing/test/audioproc_float.cc
@@ -161,6 +161,13 @@ DEFINE_int32(stream_delay,
DEFINE_int32(stream_drift_samples,
kParameterNotSpecifiedValue,
"Specify the number of stream drift samples to use");
+DEFINE_int32(initial_mic_level, 100, "Initial mic level (0-255)");
+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 +275,9 @@ SimulationSettings CreateSettings() {
&settings.stream_drift_samples);
SetSettingIfSpecified(FLAGS_custom_call_order_file,
&settings.custom_call_order_filename);
+ settings.initial_mic_level = FLAGS_initial_mic_level;
+ 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 +394,20 @@ void PerformBasicParameterSanityChecks(const SimulationSettings& settings) {
"Error: --custom_call_order_file cannot be used when operating on an "
"aecdump\n");
+ ReportConditionalErrorAndExit(
+ (settings.initial_mic_level < 0 || settings.initial_mic_level > 255),
+ "Error: --initial_mic_level must be specified between 0 and 255.\n");
+
+ ReportConditionalErrorAndExit(
+ settings.simulated_mic_kind && !settings.simulate_mic_gain,
+ "Error: --simulated_mic_kind cannot be specified when 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