Chromium Code Reviews| 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 |
| 11 #include "gflags/gflags.h" | 11 #include "gflags/gflags.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "webrtc/base/criticalsection.h" | 13 #include "webrtc/base/criticalsection.h" |
| 14 #include "webrtc/common_audio/channel_buffer.h" | 14 #include "webrtc/common_audio/channel_buffer.h" |
| 15 #include "webrtc/common_audio/include/audio_util.h" | 15 #include "webrtc/common_audio/include/audio_util.h" |
| 16 #include "webrtc/common_audio/wav_file.h" | 16 #include "webrtc/common_audio/wav_file.h" |
| 17 #include "webrtc/modules/audio_processing/audio_buffer.h" | 17 #include "webrtc/modules/audio_processing/audio_buffer.h" |
| 18 #include "webrtc/modules/audio_processing/intelligibility/intelligibility_enhanc er.h" | 18 #include "webrtc/modules/audio_processing/intelligibility/intelligibility_enhanc er.h" |
| 19 #include "webrtc/modules/audio_processing/noise_suppression_impl.h" | 19 #include "webrtc/modules/audio_processing/noise_suppression_impl.h" |
| 20 | 20 |
| 21 using std::complex; | 21 using std::complex; |
| 22 | 22 |
| 23 #if (WEBRTC_INTELLIGIBILITY_ENHANCER == 1) | |
|
hlundin-webrtc
2016/08/26 06:53:03
Isn't it sufficient that this file is only compile
| |
| 24 | |
| 23 namespace webrtc { | 25 namespace webrtc { |
| 24 namespace { | 26 namespace { |
| 25 | 27 |
| 26 DEFINE_string(clear_file, "speech.wav", "Input file with clear speech."); | 28 DEFINE_string(clear_file, "speech.wav", "Input file with clear speech."); |
| 27 DEFINE_string(noise_file, "noise.wav", "Input file with noise data."); | 29 DEFINE_string(noise_file, "noise.wav", "Input file with noise data."); |
| 28 DEFINE_string(out_file, "proc_enhanced.wav", "Enhanced output file."); | 30 DEFINE_string(out_file, "proc_enhanced.wav", "Enhanced output file."); |
| 29 | 31 |
| 30 // void function for gtest | 32 // void function for gtest |
| 31 void void_main(int argc, char* argv[]) { | 33 void void_main(int argc, char* argv[]) { |
| 32 google::SetUsageMessage( | 34 google::SetUsageMessage( |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 ns.ProcessCaptureAudio(&capture_audio); | 68 ns.ProcessCaptureAudio(&capture_audio); |
| 67 enh.SetCaptureNoiseEstimate(ns.NoiseEstimate(), 0); | 69 enh.SetCaptureNoiseEstimate(ns.NoiseEstimate(), 0); |
| 68 enh.ProcessRenderAudio(in_buf.channels(), in_file.sample_rate(), | 70 enh.ProcessRenderAudio(in_buf.channels(), in_file.sample_rate(), |
| 69 in_file.num_channels()); | 71 in_file.num_channels()); |
| 70 Interleave(in_buf.channels(), in_buf.num_frames(), in_buf.num_channels(), | 72 Interleave(in_buf.channels(), in_buf.num_frames(), in_buf.num_channels(), |
| 71 in.data()); | 73 in.data()); |
| 72 out_file.WriteSamples(in.data(), in.size()); | 74 out_file.WriteSamples(in.data(), in.size()); |
| 73 } | 75 } |
| 74 } | 76 } |
| 75 | 77 |
| 78 | |
| 76 } // namespace | 79 } // namespace |
| 77 } // namespace webrtc | 80 } // namespace webrtc |
| 78 | 81 |
| 82 #endif | |
| 83 | |
| 79 int main(int argc, char* argv[]) { | 84 int main(int argc, char* argv[]) { |
| 85 #if (WEBRTC_INTELLIGIBILITY_ENHANCER == 1) | |
| 80 webrtc::void_main(argc, argv); | 86 webrtc::void_main(argc, argv); |
| 87 #endif | |
| 81 return 0; | 88 return 0; |
| 82 } | 89 } |
| OLD | NEW |