OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 return AudioProcessing::kStereo; | 93 return AudioProcessing::kStereo; |
94 default: | 94 default: |
95 assert(false); | 95 assert(false); |
96 return AudioProcessing::kMono; | 96 return AudioProcessing::kMono; |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
100 std::vector<Point> ParseArrayGeometry(const std::string& mic_positions, | 100 std::vector<Point> ParseArrayGeometry(const std::string& mic_positions, |
101 size_t num_mics) { | 101 size_t num_mics) { |
102 const std::vector<float> values = ParseList<float>(mic_positions); | 102 const std::vector<float> values = ParseList<float>(mic_positions); |
103 CHECK_EQ(values.size(), 3 * num_mics) << | 103 RTC_CHECK_EQ(values.size(), 3 * num_mics) |
104 "Could not parse mic_positions or incorrect number of points."; | 104 << "Could not parse mic_positions or incorrect number of points."; |
105 | 105 |
106 std::vector<Point> result; | 106 std::vector<Point> result; |
107 result.reserve(num_mics); | 107 result.reserve(num_mics); |
108 for (size_t i = 0; i < values.size(); i += 3) { | 108 for (size_t i = 0; i < values.size(); i += 3) { |
109 double x = values[i + 0]; | 109 double x = values[i + 0]; |
110 double y = values[i + 1]; | 110 double y = values[i + 1]; |
111 double z = values[i + 2]; | 111 double z = values[i + 2]; |
112 result.push_back(Point(x, y, z)); | 112 result.push_back(Point(x, y, z)); |
113 } | 113 } |
114 | 114 |
115 return result; | 115 return result; |
116 } | 116 } |
117 | 117 |
118 | 118 |
119 } // namespace webrtc | 119 } // namespace webrtc |
OLD | NEW |