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 18 matching lines...) Expand all Loading... |
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 // Sets the capture noise magnitude spectrum estimate. | 38 // Sets the capture noise magnitude spectrum estimate. |
39 void SetCaptureNoiseEstimate(std::vector<float> noise, int gain_db); | 39 void SetCaptureNoiseEstimate(std::vector<float> noise, float gain); |
40 | 40 |
41 // Reads chunk of speech in time domain and updates with modified signal. | 41 // Reads chunk of speech in time domain and updates with modified signal. |
42 void ProcessRenderAudio(float* const* audio, | 42 void ProcessRenderAudio(float* const* audio, |
43 int sample_rate_hz, | 43 int sample_rate_hz, |
44 size_t num_channels); | 44 size_t num_channels); |
45 bool active() const; | 45 bool active() const; |
46 | 46 |
47 protected: | 47 protected: |
48 // All in frequency domain, receives input |in_block|, applies | 48 // All in frequency domain, receives input |in_block|, applies |
49 // intelligibility enhancement, and writes result to |out_block|. | 49 // intelligibility enhancement, and writes result to |out_block|. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 size_t num_chunks_; | 115 size_t num_chunks_; |
116 | 116 |
117 std::vector<float> noise_estimation_buffer_; | 117 std::vector<float> noise_estimation_buffer_; |
118 SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>> | 118 SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>> |
119 noise_estimation_queue_; | 119 noise_estimation_queue_; |
120 }; | 120 }; |
121 | 121 |
122 } // namespace webrtc | 122 } // namespace webrtc |
123 | 123 |
124 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_ENHAN
CER_H_ | 124 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_ENHAN
CER_H_ |
OLD | NEW |