#include "modules/audio_processing/agc2/vad_wrapper.h"
#include <limits>
#include <memory>
#include <tuple>
#include <utility>
#include <vector>
#include "api/audio/audio_view.h"
#include "modules/audio_processing/agc2/agc2_common.h"
#include "rtc_base/checks.h"
#include "rtc_base/gunit.h"
#include "rtc_base/numerics/safe_compare.h"
#include "test/gmock.h"
namespace webrtc {
namespace {
AnyNumber;
Return;
ReturnRoundRobin;
Truly;
constexpr int kNumFramesPerSecond = …;
constexpr int kNoVadPeriodicReset = …;
constexpr int kSampleRate8kHz = …;
class MockVad : public VoiceActivityDetectorWrapper::MonoVad { … };
TEST(GainController2VoiceActivityDetectorWrapper, CtorAndInitReadSampleRate) { … }
std::unique_ptr<VoiceActivityDetectorWrapper> CreateMockVadWrapper(
int vad_reset_period_ms,
int sample_rate_hz,
const std::vector<float>& speech_probabilities,
int expected_vad_reset_calls) { … }
struct FrameWithView { … };
TEST(GainController2VoiceActivityDetectorWrapper, CheckSpeechProbabilities) { … }
TEST(GainController2VoiceActivityDetectorWrapper, VadNoPeriodicReset) { … }
class VadPeriodResetParametrization
: public ::testing::TestWithParam<std::tuple<int, int>> { … };
TEST_P(VadPeriodResetParametrization, VadPeriodicReset) { … }
INSTANTIATE_TEST_SUITE_P(…);
class VadResamplingParametrization
: public ::testing::TestWithParam<std::tuple<int, int>> { … };
TEST_P(VadResamplingParametrization, CheckResampledFrameSize) { … }
INSTANTIATE_TEST_SUITE_P(…);
}
}