OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 if (temp_filenames[filename].empty()) | 283 if (temp_filenames[filename].empty()) |
284 temp_filenames[filename] = test::TempFilename(test::OutputPath(), filename); | 284 temp_filenames[filename] = test::TempFilename(test::OutputPath(), filename); |
285 return temp_filenames[filename]; | 285 return temp_filenames[filename]; |
286 } | 286 } |
287 | 287 |
288 void ClearTempFiles() { | 288 void ClearTempFiles() { |
289 for (auto& kv : temp_filenames) | 289 for (auto& kv : temp_filenames) |
290 remove(kv.second.c_str()); | 290 remove(kv.second.c_str()); |
291 } | 291 } |
292 | 292 |
293 void OpenFileAndReadMessage(const std::string filename, | 293 void OpenFileAndReadMessage(std::string filename, |
294 ::google::protobuf::MessageLite* msg) { | 294 ::google::protobuf::MessageLite* msg) { |
295 FILE* file = fopen(filename.c_str(), "rb"); | 295 FILE* file = fopen(filename.c_str(), "rb"); |
296 ASSERT_TRUE(file != NULL); | 296 ASSERT_TRUE(file != NULL); |
297 ReadMessageFromFile(file, msg); | 297 ReadMessageFromFile(file, msg); |
298 fclose(file); | 298 fclose(file); |
299 } | 299 } |
300 | 300 |
301 // Reads a 10 ms chunk of int16 interleaved audio from the given (assumed | 301 // Reads a 10 ms chunk of int16 interleaved audio from the given (assumed |
302 // stereo) file, converts to deinterleaved float (optionally downmixing) and | 302 // stereo) file, converts to deinterleaved float (optionally downmixing) and |
303 // returns the result in |cb|. Returns false if the file ended (or on error) and | 303 // returns the result in |cb|. Returns false if the file ended (or on error) and |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 std::unique_ptr<ChannelBuffer<float> > revfloat_cb_; | 394 std::unique_ptr<ChannelBuffer<float> > revfloat_cb_; |
395 int output_sample_rate_hz_; | 395 int output_sample_rate_hz_; |
396 size_t num_output_channels_; | 396 size_t num_output_channels_; |
397 FILE* far_file_; | 397 FILE* far_file_; |
398 FILE* near_file_; | 398 FILE* near_file_; |
399 FILE* out_file_; | 399 FILE* out_file_; |
400 }; | 400 }; |
401 | 401 |
402 ApmTest::ApmTest() | 402 ApmTest::ApmTest() |
403 : output_path_(test::OutputPath()), | 403 : output_path_(test::OutputPath()), |
| 404 #ifndef WEBRTC_IOS |
404 ref_path_(test::ProjectRootPath() + "data/audio_processing/"), | 405 ref_path_(test::ProjectRootPath() + "data/audio_processing/"), |
| 406 #else |
| 407 // On iOS test data is flat in the project root dir |
| 408 ref_path_(test::ProjectRootPath()), |
| 409 #endif |
405 #if defined(WEBRTC_AUDIOPROC_FIXED_PROFILE) | 410 #if defined(WEBRTC_AUDIOPROC_FIXED_PROFILE) |
406 ref_filename_(ref_path_ + "output_data_fixed.pb"), | 411 ref_filename_(ref_path_ + "output_data_fixed.pb"), |
407 #elif defined(WEBRTC_AUDIOPROC_FLOAT_PROFILE) | 412 #elif defined(WEBRTC_AUDIOPROC_FLOAT_PROFILE) |
408 #if defined(WEBRTC_MAC) | 413 #if defined(WEBRTC_MAC) |
409 // A different file for Mac is needed because on this platform the AEC | 414 // A different file for Mac is needed because on this platform the AEC |
410 // constant |kFixedDelayMs| value is 20 and not 50 as it is on the rest. | 415 // constant |kFixedDelayMs| value is 20 and not 50 as it is on the rest. |
411 ref_filename_(ref_path_ + "output_data_mac.pb"), | 416 ref_filename_(ref_path_ + "output_data_mac.pb"), |
412 #else | 417 #else |
413 ref_filename_(ref_path_ + "output_data_float.pb"), | 418 ref_filename_(ref_path_ + "output_data_float.pb"), |
414 #endif | 419 #endif |
(...skipping 2353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2768 std::tr1::make_tuple(16000, 32000, 48000, 32000, 25, 35), | 2773 std::tr1::make_tuple(16000, 32000, 48000, 32000, 25, 35), |
2769 std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0), | 2774 std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0), |
2770 std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20), | 2775 std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20), |
2771 std::tr1::make_tuple(16000, 16000, 48000, 16000, 35, 20), | 2776 std::tr1::make_tuple(16000, 16000, 48000, 16000, 35, 20), |
2772 std::tr1::make_tuple(16000, 16000, 32000, 16000, 35, 20), | 2777 std::tr1::make_tuple(16000, 16000, 32000, 16000, 35, 20), |
2773 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0))); | 2778 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0))); |
2774 #endif | 2779 #endif |
2775 | 2780 |
2776 } // namespace | 2781 } // namespace |
2777 } // namespace webrtc | 2782 } // namespace webrtc |
OLD | NEW |