niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
bjornv@webrtc.org | 0c6f931 | 2012-01-30 09:39:08 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
bjornv@webrtc.org | 0c6f931 | 2012-01-30 09:39:08 +0000 | [diff] [blame] | 11 | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_NOISE_SUPPRESSION_IMPL_H_ |
| 12 | #define WEBRTC_MODULES_AUDIO_PROCESSING_NOISE_SUPPRESSION_IMPL_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | |
pbos@webrtc.org | 7fad4b8 | 2013-05-28 08:11:59 +0000 | [diff] [blame] | 14 | #include "webrtc/modules/audio_processing/include/audio_processing.h" |
| 15 | #include "webrtc/modules/audio_processing/processing_component.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 16 | |
| 17 | namespace webrtc { |
andrew@webrtc.org | 56e4a05 | 2014-02-27 22:23:17 +0000 | [diff] [blame] | 18 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 19 | class AudioBuffer; |
andrew@webrtc.org | 56e4a05 | 2014-02-27 22:23:17 +0000 | [diff] [blame] | 20 | class CriticalSectionWrapper; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 21 | |
| 22 | class NoiseSuppressionImpl : public NoiseSuppression, |
| 23 | public ProcessingComponent { |
| 24 | public: |
andrew@webrtc.org | 56e4a05 | 2014-02-27 22:23:17 +0000 | [diff] [blame] | 25 | NoiseSuppressionImpl(const AudioProcessing* apm, |
| 26 | CriticalSectionWrapper* crit); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 27 | virtual ~NoiseSuppressionImpl(); |
| 28 | |
| 29 | int ProcessCaptureAudio(AudioBuffer* audio); |
| 30 | |
| 31 | // NoiseSuppression implementation. |
pbos@webrtc.org | 9162080 | 2013-08-02 11:44:11 +0000 | [diff] [blame] | 32 | virtual bool is_enabled() const OVERRIDE; |
| 33 | virtual float speech_probability() const OVERRIDE; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 34 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 35 | private: |
| 36 | // NoiseSuppression implementation. |
pbos@webrtc.org | 9162080 | 2013-08-02 11:44:11 +0000 | [diff] [blame] | 37 | virtual int Enable(bool enable) OVERRIDE; |
| 38 | virtual int set_level(Level level) OVERRIDE; |
| 39 | virtual Level level() const OVERRIDE; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 40 | |
| 41 | // ProcessingComponent implementation. |
pbos@webrtc.org | 9162080 | 2013-08-02 11:44:11 +0000 | [diff] [blame] | 42 | virtual void* CreateHandle() const OVERRIDE; |
| 43 | virtual int InitializeHandle(void* handle) const OVERRIDE; |
| 44 | virtual int ConfigureHandle(void* handle) const OVERRIDE; |
| 45 | virtual int DestroyHandle(void* handle) const OVERRIDE; |
| 46 | virtual int num_handles_required() const OVERRIDE; |
| 47 | virtual int GetHandleError(void* handle) const OVERRIDE; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 48 | |
andrew@webrtc.org | 56e4a05 | 2014-02-27 22:23:17 +0000 | [diff] [blame] | 49 | const AudioProcessing* apm_; |
| 50 | CriticalSectionWrapper* crit_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 51 | Level level_; |
| 52 | }; |
andrew@webrtc.org | 56e4a05 | 2014-02-27 22:23:17 +0000 | [diff] [blame] | 53 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 54 | } // namespace webrtc |
| 55 | |
bjornv@webrtc.org | 0c6f931 | 2012-01-30 09:39:08 +0000 | [diff] [blame] | 56 | #endif // WEBRTC_MODULES_AUDIO_PROCESSING_NOISE_SUPPRESSION_IMPL_H_ |