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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 while (in_file.ReadSamples(in.size(), in.data()) == in.size() && | 57 while (in_file.ReadSamples(in.size(), in.data()) == in.size() && |
58 noise_file.ReadSamples(noise.size(), noise.data()) == noise.size()) { | 58 noise_file.ReadSamples(noise.size(), noise.data()) == noise.size()) { |
59 FloatS16ToFloat(noise.data(), noise.size(), noise.data()); | 59 FloatS16ToFloat(noise.data(), noise.size(), noise.data()); |
60 Deinterleave(in.data(), in_buf.num_frames(), in_buf.num_channels(), | 60 Deinterleave(in.data(), in_buf.num_frames(), in_buf.num_channels(), |
61 in_buf.channels()); | 61 in_buf.channels()); |
62 Deinterleave(noise.data(), noise_buf.num_frames(), noise_buf.num_channels(), | 62 Deinterleave(noise.data(), noise_buf.num_frames(), noise_buf.num_channels(), |
63 noise_buf.channels()); | 63 noise_buf.channels()); |
64 capture_audio.CopyFrom(noise_buf.channels(), stream_config); | 64 capture_audio.CopyFrom(noise_buf.channels(), stream_config); |
65 ns.AnalyzeCaptureAudio(&capture_audio); | 65 ns.AnalyzeCaptureAudio(&capture_audio); |
66 ns.ProcessCaptureAudio(&capture_audio); | 66 ns.ProcessCaptureAudio(&capture_audio); |
67 enh.SetCaptureNoiseEstimate(ns.NoiseEstimate()); | 67 enh.SetCaptureNoiseEstimate(ns.NoiseEstimate(), 0); |
68 enh.ProcessRenderAudio(in_buf.channels(), in_file.sample_rate(), | 68 enh.ProcessRenderAudio(in_buf.channels(), in_file.sample_rate(), |
69 in_file.num_channels()); | 69 in_file.num_channels()); |
70 Interleave(in_buf.channels(), in_buf.num_frames(), in_buf.num_channels(), | 70 Interleave(in_buf.channels(), in_buf.num_frames(), in_buf.num_channels(), |
71 in.data()); | 71 in.data()); |
72 out_file.WriteSamples(in.data(), in.size()); | 72 out_file.WriteSamples(in.data(), in.size()); |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 } // namespace | 76 } // namespace |
77 } // namespace webrtc | 77 } // namespace webrtc |
78 | 78 |
79 int main(int argc, char* argv[]) { | 79 int main(int argc, char* argv[]) { |
80 webrtc::void_main(argc, argv); | 80 webrtc::void_main(argc, argv); |
81 return 0; | 81 return 0; |
82 } | 82 } |
OLD | NEW |