#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/speech/endpointer/energy_endpointer.h"
#include <math.h>
#include <stddef.h>
#include "base/logging.h"
namespace {
float RMS(const int16_t* samples, int num_samples) { … }
int64_t Secs2Usecs(float seconds) { … }
float GetDecibel(float value) { … }
}
namespace speech {
class EnergyEndpointer::HistoryRing { … };
void EnergyEndpointer::HistoryRing::SetRing(int size, bool initial_state) { … }
void EnergyEndpointer::HistoryRing::Insert(int64_t time_us, bool decision) { … }
int64_t EnergyEndpointer::HistoryRing::EndTime() const { … }
float EnergyEndpointer::HistoryRing::RingSum(float duration_sec) { … }
EnergyEndpointer::EnergyEndpointer()
: … { … }
EnergyEndpointer::~EnergyEndpointer() { … }
int EnergyEndpointer::TimeToFrame(float time) const { … }
void EnergyEndpointer::Restart(bool reset_threshold) { … }
void EnergyEndpointer::Init(const EnergyEndpointerParams& params) { … }
void EnergyEndpointer::StartSession() { … }
void EnergyEndpointer::EndSession() { … }
void EnergyEndpointer::SetEnvironmentEstimationMode() { … }
void EnergyEndpointer::SetUserInputMode() { … }
void EnergyEndpointer::ProcessAudioFrame(int64_t time_us,
const int16_t* samples,
int num_samples,
float* rms_out) { … }
float EnergyEndpointer::GetNoiseLevelDb() const { … }
void EnergyEndpointer::UpdateLevels(float rms) { … }
EpStatus EnergyEndpointer::Status(int64_t* status_time) const { … }
}