chromium/components/speech/endpointer/energy_endpointer.cc

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// To know more about the algorithm used and the original code which this is
// based of, see
// https://wiki.corp.google.com/twiki/bin/view/Main/ChromeGoogleCodeXRef

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "components/speech/endpointer/energy_endpointer.h"

#include <math.h>
#include <stddef.h>

#include "base/logging.h"

namespace {

// Returns the RMS (quadratic mean) of the input signal.
float RMS(const int16_t* samples, int num_samples) {}

int64_t Secs2Usecs(float seconds) {}

float GetDecibel(float value) {}

}  // namespace

namespace speech {

// Stores threshold-crossing histories for making decisions about the speech
// state.
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 {}

}  // namespace speech