transparent_mode.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
  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. #ifndef MODULES_AUDIO_PROCESSING_AEC3_TRANSPARENT_MODE_H_
  11. #define MODULES_AUDIO_PROCESSING_AEC3_TRANSPARENT_MODE_H_
  12. #include <memory>
  13. #include "api/audio/echo_canceller3_config.h"
  14. #include "modules/audio_processing/aec3/aec3_common.h"
  15. namespace webrtc {
  16. // Class for detecting and toggling the transparent mode which causes the
  17. // suppressor to apply less suppression.
  18. class TransparentMode {
  19. public:
  20. static std::unique_ptr<TransparentMode> Create(
  21. const EchoCanceller3Config& config);
  22. virtual ~TransparentMode() {}
  23. // Returns whether the transparent mode should be active.
  24. virtual bool Active() const = 0;
  25. // Resets the state of the detector.
  26. virtual void Reset() = 0;
  27. // Updates the detection decision based on new data.
  28. virtual void Update(int filter_delay_blocks,
  29. bool any_filter_consistent,
  30. bool any_filter_converged,
  31. bool any_coarse_filter_converged,
  32. bool all_filters_diverged,
  33. bool active_render,
  34. bool saturated_capture) = 0;
  35. };
  36. } // namespace webrtc
  37. #endif // MODULES_AUDIO_PROCESSING_AEC3_TRANSPARENT_MODE_H_