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 // void function for gtest | 30 // void function for gtest |
31 void void_main(int argc, char* argv[]) { | 31 void void_main(int argc, char* argv[]) { |
32 google::SetUsageMessage( | 32 google::SetUsageMessage( |
33 "\n\nInput files must be little-endian 16-bit signed raw PCM.\n"); | 33 "\n\nInput files must be little-endian 16-bit signed raw PCM.\n"); |
34 google::ParseCommandLineFlags(&argc, &argv, true); | 34 google::ParseCommandLineFlags(&argc, &argv, true); |
35 | 35 |
36 WavReader in_file(FLAGS_clear_file); | 36 WavReader in_file(FLAGS_clear_file); |
37 WavReader noise_file(FLAGS_noise_file); | 37 WavReader noise_file(FLAGS_noise_file); |
38 WavWriter out_file(FLAGS_out_file, in_file.sample_rate(), | 38 WavWriter out_file(FLAGS_out_file, in_file.sample_rate(), |
39 in_file.num_channels()); | 39 in_file.num_channels()); |
40 IntelligibilityEnhancer enh(in_file.sample_rate(), in_file.num_channels()); | |
41 rtc::CriticalSection crit; | 40 rtc::CriticalSection crit; |
42 NoiseSuppressionImpl ns(&crit); | 41 NoiseSuppressionImpl ns(&crit); |
| 42 IntelligibilityEnhancer enh(in_file.sample_rate(), in_file.num_channels(), |
| 43 NoiseSuppressionImpl::num_noise_bins()); |
43 ns.Initialize(noise_file.num_channels(), noise_file.sample_rate()); | 44 ns.Initialize(noise_file.num_channels(), noise_file.sample_rate()); |
44 ns.Enable(true); | 45 ns.Enable(true); |
45 const size_t in_samples = noise_file.sample_rate() / 100; | 46 const size_t in_samples = noise_file.sample_rate() / 100; |
46 const size_t noise_samples = noise_file.sample_rate() / 100; | 47 const size_t noise_samples = noise_file.sample_rate() / 100; |
47 std::vector<float> in(in_samples * in_file.num_channels()); | 48 std::vector<float> in(in_samples * in_file.num_channels()); |
48 std::vector<float> noise(noise_samples * noise_file.num_channels()); | 49 std::vector<float> noise(noise_samples * noise_file.num_channels()); |
49 ChannelBuffer<float> in_buf(in_samples, in_file.num_channels()); | 50 ChannelBuffer<float> in_buf(in_samples, in_file.num_channels()); |
50 ChannelBuffer<float> noise_buf(noise_samples, noise_file.num_channels()); | 51 ChannelBuffer<float> noise_buf(noise_samples, noise_file.num_channels()); |
51 AudioBuffer capture_audio(noise_samples, noise_file.num_channels(), | 52 AudioBuffer capture_audio(noise_samples, noise_file.num_channels(), |
52 noise_samples, noise_file.num_channels(), | 53 noise_samples, noise_file.num_channels(), |
(...skipping 21 matching lines...) Expand all Loading... |
74 } | 75 } |
75 } | 76 } |
76 | 77 |
77 } // namespace | 78 } // namespace |
78 } // namespace webrtc | 79 } // namespace webrtc |
79 | 80 |
80 int main(int argc, char* argv[]) { | 81 int main(int argc, char* argv[]) { |
81 webrtc::void_main(argc, argv); | 82 webrtc::void_main(argc, argv); |
82 return 0; | 83 return 0; |
83 } | 84 } |
OLD | NEW |