OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 #include <vector> | 10 #include <vector> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 bool drift_compensation_enabled, | 42 bool drift_compensation_enabled, |
43 int stream_drift_samples, | 43 int stream_drift_samples, |
44 AudioBuffer* render_audio_buffer, | 44 AudioBuffer* render_audio_buffer, |
45 AudioBuffer* capture_audio_buffer, | 45 AudioBuffer* capture_audio_buffer, |
46 EchoCancellationImpl* echo_canceller) { | 46 EchoCancellationImpl* echo_canceller) { |
47 if (sample_rate_hz > AudioProcessing::kSampleRate16kHz) { | 47 if (sample_rate_hz > AudioProcessing::kSampleRate16kHz) { |
48 render_audio_buffer->SplitIntoFrequencyBands(); | 48 render_audio_buffer->SplitIntoFrequencyBands(); |
49 capture_audio_buffer->SplitIntoFrequencyBands(); | 49 capture_audio_buffer->SplitIntoFrequencyBands(); |
50 } | 50 } |
51 | 51 |
52 echo_canceller->ProcessRenderAudio(render_audio_buffer); | 52 std::vector<float> render_audio; |
53 echo_canceller->ReadQueuedRenderData(); | 53 EchoCancellationImpl::PackRenderAudioBuffer( |
| 54 render_audio_buffer, 1, render_audio_buffer->num_channels(), |
| 55 &render_audio); |
| 56 echo_canceller->ProcessRenderAudio(render_audio); |
54 | 57 |
55 if (drift_compensation_enabled) { | 58 if (drift_compensation_enabled) { |
56 static_cast<EchoCancellation*>(echo_canceller) | 59 static_cast<EchoCancellation*>(echo_canceller) |
57 ->set_stream_drift_samples(stream_drift_samples); | 60 ->set_stream_drift_samples(stream_drift_samples); |
58 } | 61 } |
59 | 62 |
60 echo_canceller->ProcessCaptureAudio(capture_audio_buffer, stream_delay_ms); | 63 echo_canceller->ProcessCaptureAudio(capture_audio_buffer, stream_delay_ms); |
61 | 64 |
62 if (sample_rate_hz > AudioProcessing::kSampleRate16kHz) { | 65 if (sample_rate_hz > AudioProcessing::kSampleRate16kHz) { |
63 capture_audio_buffer->MergeFrequencyBands(); | 66 capture_audio_buffer->MergeFrequencyBands(); |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 DISABLED_Stereo48kHz_HighLevel_NoDrift_StreamDelay0) { | 348 DISABLED_Stereo48kHz_HighLevel_NoDrift_StreamDelay0) { |
346 #endif | 349 #endif |
347 const float kOutputReference[] = {-0.001101f, -0.001101f, -0.000449f, | 350 const float kOutputReference[] = {-0.001101f, -0.001101f, -0.000449f, |
348 -0.001101f, -0.001101f, -0.000449f}; | 351 -0.001101f, -0.001101f, -0.000449f}; |
349 RunBitexactnessTest(48000, 2, 0, false, 0, | 352 RunBitexactnessTest(48000, 2, 0, false, 0, |
350 EchoCancellation::SuppressionLevel::kHighSuppression, | 353 EchoCancellation::SuppressionLevel::kHighSuppression, |
351 kStreamHasEchoReference, kOutputReference); | 354 kStreamHasEchoReference, kOutputReference); |
352 } | 355 } |
353 | 356 |
354 } // namespace webrtc | 357 } // namespace webrtc |
OLD | NEW |