Changed target_angle_degrees in audioproc_float to float to avoid integer division when converting to radians
Change-Id: I1b12d03524c34ed3fc4da89216539fd31a5c703b
Bug: none
Change-Id: I1b12d03524c34ed3fc4da89216539fd31a5c703b
Reviewed-on: https://webrtc-review.googlesource.com/61942
Commit-Queue: Alejandro Luebs <aluebs@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22462}
diff --git a/modules/audio_processing/test/audio_processing_simulator.h b/modules/audio_processing/test/audio_processing_simulator.h
index c557b7f..98a2843 100644
--- a/modules/audio_processing/test/audio_processing_simulator.h
+++ b/modules/audio_processing/test/audio_processing_simulator.h
@@ -41,7 +41,7 @@
rtc::Optional<int> reverse_output_sample_rate_hz;
rtc::Optional<int> reverse_output_num_channels;
rtc::Optional<std::string> microphone_positions;
- int target_angle_degrees = 90;
+ float target_angle_degrees = 90.f;
rtc::Optional<std::string> output_filename;
rtc::Optional<std::string> reverse_output_filename;
rtc::Optional<std::string> input_filename;
diff --git a/modules/audio_processing/test/audioproc_float_impl.cc b/modules/audio_processing/test/audioproc_float_impl.cc
index de6fb65..a698db3 100644
--- a/modules/audio_processing/test/audioproc_float_impl.cc
+++ b/modules/audio_processing/test/audioproc_float_impl.cc
@@ -61,10 +61,10 @@
"Space delimited cartesian coordinates of microphones in "
"meters. The coordinates of each point are contiguous. For a "
"two element array: \"x1 y1 z1 x2 y2 z2\"");
-DEFINE_int(target_angle_degrees,
- 90,
- "The azimuth of the target in degrees (0-359). Only applies to "
- "beamforming.");
+DEFINE_float(target_angle_degrees,
+ 90.f,
+ "The azimuth of the target in degrees (0-360). Only applies to "
+ "beamforming.");
DEFINE_bool(fixed_interface,
false,
"Use the fixed interface when operating on wav files");
@@ -357,8 +357,9 @@
"activated.\n");
ReportConditionalErrorAndExit(
- settings.target_angle_degrees < 0 || settings.target_angle_degrees > 359,
- "Error: -target_angle_degrees must be specified between 0 and 359.\n");
+ settings.target_angle_degrees < 0.f ||
+ settings.target_angle_degrees >= 360.f,
+ "Error: -target_angle_degrees must be specified between 0 and 360.\n");
ReportConditionalErrorAndExit(
settings.aec_suppression_level &&