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 17 matching lines...) Expand all Loading... |
28 // audio streams and modifies the render stream with a set of gains per | 28 // audio streams and modifies the render stream with a set of gains per |
29 // frequency bin to enhance speech against the noise background. | 29 // frequency bin to enhance speech against the noise background. |
30 // Details of the model and algorithm can be found in the original paper: | 30 // Details of the model and algorithm can be found in the original paper: |
31 // http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6882788 | 31 // http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6882788 |
32 class IntelligibilityEnhancer : public LappedTransform::Callback { | 32 class IntelligibilityEnhancer : public LappedTransform::Callback { |
33 public: | 33 public: |
34 IntelligibilityEnhancer(int sample_rate_hz, | 34 IntelligibilityEnhancer(int sample_rate_hz, |
35 size_t num_render_channels, | 35 size_t num_render_channels, |
36 size_t num_noise_bins); | 36 size_t num_noise_bins); |
37 | 37 |
38 ~IntelligibilityEnhancer(); | 38 ~IntelligibilityEnhancer() override; |
39 | 39 |
40 // Sets the capture noise magnitude spectrum estimate. | 40 // Sets the capture noise magnitude spectrum estimate. |
41 void SetCaptureNoiseEstimate(std::vector<float> noise, float gain); | 41 void SetCaptureNoiseEstimate(std::vector<float> noise, float gain); |
42 | 42 |
43 // Reads chunk of speech in time domain and updates with modified signal. | 43 // Reads chunk of speech in time domain and updates with modified signal. |
44 void ProcessRenderAudio(float* const* audio, | 44 void ProcessRenderAudio(float* const* audio, |
45 int sample_rate_hz, | 45 int sample_rate_hz, |
46 size_t num_channels); | 46 size_t num_channels); |
47 bool active() const; | 47 bool active() const; |
48 | 48 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 unsigned long int num_active_chunks_; | 118 unsigned long int num_active_chunks_; |
119 | 119 |
120 std::vector<float> noise_estimation_buffer_; | 120 std::vector<float> noise_estimation_buffer_; |
121 SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>> | 121 SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>> |
122 noise_estimation_queue_; | 122 noise_estimation_queue_; |
123 }; | 123 }; |
124 | 124 |
125 } // namespace webrtc | 125 } // namespace webrtc |
126 | 126 |
127 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_ENHAN
CER_H_ | 127 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_ENHAN
CER_H_ |
OLD | NEW |