OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 19 matching lines...) Expand all Loading... |
30 DEFINE_string(o_rev, | 30 DEFINE_string(o_rev, |
31 "out_rev.wav", | 31 "out_rev.wav", |
32 "Name of the reverse output file to write to."); | 32 "Name of the reverse output file to write to."); |
33 DEFINE_int32(out_channels, 0, "Number of output channels. Defaults to input."); | 33 DEFINE_int32(out_channels, 0, "Number of output channels. Defaults to input."); |
34 DEFINE_int32(out_sample_rate, 0, | 34 DEFINE_int32(out_sample_rate, 0, |
35 "Output sample rate in Hz. Defaults to input."); | 35 "Output sample rate in Hz. Defaults to input."); |
36 DEFINE_string(mic_positions, "", | 36 DEFINE_string(mic_positions, "", |
37 "Space delimited cartesian coordinates of microphones in meters. " | 37 "Space delimited cartesian coordinates of microphones in meters. " |
38 "The coordinates of each point are contiguous. " | 38 "The coordinates of each point are contiguous. " |
39 "For a two element array: \"x1 y1 z1 x2 y2 z2\""); | 39 "For a two element array: \"x1 y1 z1 x2 y2 z2\""); |
| 40 DEFINE_double(target_angle_degrees, 90, "The azimuth of the target in radians"); |
40 | 41 |
41 DEFINE_bool(aec, false, "Enable echo cancellation."); | 42 DEFINE_bool(aec, false, "Enable echo cancellation."); |
42 DEFINE_bool(agc, false, "Enable automatic gain control."); | 43 DEFINE_bool(agc, false, "Enable automatic gain control."); |
43 DEFINE_bool(hpf, false, "Enable high-pass filtering."); | 44 DEFINE_bool(hpf, false, "Enable high-pass filtering."); |
44 DEFINE_bool(ns, false, "Enable noise suppression."); | 45 DEFINE_bool(ns, false, "Enable noise suppression."); |
45 DEFINE_bool(ts, false, "Enable transient suppression."); | 46 DEFINE_bool(ts, false, "Enable transient suppression."); |
46 DEFINE_bool(bf, false, "Enable beamforming."); | 47 DEFINE_bool(bf, false, "Enable beamforming."); |
47 DEFINE_bool(ie, false, "Enable intelligibility enhancer."); | 48 DEFINE_bool(ie, false, "Enable intelligibility enhancer."); |
48 DEFINE_bool(all, false, "Enable all components."); | 49 DEFINE_bool(all, false, "Enable all components."); |
49 | 50 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 Config config; | 101 Config config; |
101 config.Set<ExperimentalNs>(new ExperimentalNs(FLAGS_ts || FLAGS_all)); | 102 config.Set<ExperimentalNs>(new ExperimentalNs(FLAGS_ts || FLAGS_all)); |
102 config.Set<Intelligibility>(new Intelligibility(FLAGS_ie || FLAGS_all)); | 103 config.Set<Intelligibility>(new Intelligibility(FLAGS_ie || FLAGS_all)); |
103 | 104 |
104 if (FLAGS_bf || FLAGS_all) { | 105 if (FLAGS_bf || FLAGS_all) { |
105 const size_t num_mics = in_file.num_channels(); | 106 const size_t num_mics = in_file.num_channels(); |
106 const std::vector<Point> array_geometry = | 107 const std::vector<Point> array_geometry = |
107 ParseArrayGeometry(FLAGS_mic_positions, num_mics); | 108 ParseArrayGeometry(FLAGS_mic_positions, num_mics); |
108 RTC_CHECK_EQ(array_geometry.size(), num_mics); | 109 RTC_CHECK_EQ(array_geometry.size(), num_mics); |
109 | 110 |
110 config.Set<Beamforming>(new Beamforming(true, array_geometry)); | 111 config.Set<Beamforming>(new Beamforming( |
| 112 true, array_geometry, |
| 113 SphericalPointf(DegreesToRadians(FLAGS_target_angle_degrees), 0.f, |
| 114 1.f))); |
111 } | 115 } |
112 | 116 |
113 rtc::scoped_ptr<AudioProcessing> ap(AudioProcessing::Create(config)); | 117 rtc::scoped_ptr<AudioProcessing> ap(AudioProcessing::Create(config)); |
114 if (!FLAGS_dump.empty()) { | 118 if (!FLAGS_dump.empty()) { |
115 RTC_CHECK_EQ(kNoErr, | 119 RTC_CHECK_EQ(kNoErr, |
116 ap->echo_cancellation()->Enable(FLAGS_aec || FLAGS_all)); | 120 ap->echo_cancellation()->Enable(FLAGS_aec || FLAGS_all)); |
117 } else if (FLAGS_aec) { | 121 } else if (FLAGS_aec) { |
118 fprintf(stderr, "-aec requires a -dump file.\n"); | 122 fprintf(stderr, "-aec requires a -dump file.\n"); |
119 return -1; | 123 return -1; |
120 } | 124 } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 execution_time_ms * 1.f / num_chunks); | 237 execution_time_ms * 1.f / num_chunks); |
234 } | 238 } |
235 return 0; | 239 return 0; |
236 } | 240 } |
237 | 241 |
238 } // namespace webrtc | 242 } // namespace webrtc |
239 | 243 |
240 int main(int argc, char* argv[]) { | 244 int main(int argc, char* argv[]) { |
241 return webrtc::main(argc, argv); | 245 return webrtc::main(argc, argv); |
242 } | 246 } |
OLD | NEW |