chromium/content/browser/speech/soda_speech_recognition_engine_impl.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.

#include "content/browser/speech/soda_speech_recognition_engine_impl.h"

#include <string.h>

#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h"
#include "content/browser/speech/speech_recognition_engine.h"
#include "content/browser/speech/speech_recognition_manager_impl.h"
#include "content/public/browser/speech_recognition_manager_delegate.h"
#include "content/public/browser/speech_recognition_session_config.h"
#include "media/mojo/mojom/audio_data.mojom.h"
#include "media/mojo/mojom/media_types.mojom.h"
#include "media/mojo/mojom/speech_recognition.mojom.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"

namespace content {

namespace {
// Duration of each audio packet.
constexpr int kAudioPacketIntervalMs =;
constexpr float kSpeechRecognitionConfidence =;

// Substitute the real instances in browser and unit tests.
SpeechRecognitionManagerDelegate* speech_recognition_mgr_delegate_for_tests =;
}  // namespace

SodaSpeechRecognitionEngineImpl::SodaSpeechRecognitionEngineImpl(
    const SpeechRecognitionSessionConfig& config)
    :{}

SodaSpeechRecognitionEngineImpl::~SodaSpeechRecognitionEngineImpl() = default;

bool SodaSpeechRecognitionEngineImpl::Initialize() {}

void SodaSpeechRecognitionEngineImpl::StartRecognition() {}

void SodaSpeechRecognitionEngineImpl::EndRecognition() {}

void SodaSpeechRecognitionEngineImpl::TakeAudioChunk(const AudioChunk& data) {}

void SodaSpeechRecognitionEngineImpl::AudioChunksEnded() {}

int SodaSpeechRecognitionEngineImpl::GetDesiredAudioChunkDurationMs() const {}

// media::mojom::SpeechRecognitionRecognizerClient:
void SodaSpeechRecognitionEngineImpl::OnSpeechRecognitionRecognitionEvent(
    const media::SpeechRecognitionResult& recognition_result,
    OnSpeechRecognitionRecognitionEventCallback reply) {}

void SodaSpeechRecognitionEngineImpl::OnSpeechRecognitionError() {}

void SodaSpeechRecognitionEngineImpl::OnLanguageIdentificationEvent(
    media::mojom::LanguageIdentificationEventPtr event) {}

void SodaSpeechRecognitionEngineImpl::OnSpeechRecognitionStopped() {}

void SodaSpeechRecognitionEngineImpl::
    SetSpeechRecognitionManagerDelegateForTesting(
        SpeechRecognitionManagerDelegate* delegate) {}

void SodaSpeechRecognitionEngineImpl::SetOnReadyCallback(
    base::OnceCallback<void()> callback) {}

void SodaSpeechRecognitionEngineImpl::OnRecognizerBound(
    bool is_multichannel_supported) {}

void SodaSpeechRecognitionEngineImpl::OnRecognizerDisconnected() {}

void SodaSpeechRecognitionEngineImpl::SendAudioToSpeechRecognitionService(
    media::mojom::AudioDataS16Ptr audio_data) {}

void SodaSpeechRecognitionEngineImpl::MarkDone() {}

void SodaSpeechRecognitionEngineImpl::Abort(
    media::mojom::SpeechRecognitionErrorCode error_code) {}

media::mojom::AudioDataS16Ptr
SodaSpeechRecognitionEngineImpl::ConvertToAudioDataS16(
    const AudioChunk& audio_data) {}

}  // namespace content