chromium/chrome/services/speech/soda/soda_async_impl.h

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_SERVICES_SPEECH_SODA_SODA_ASYNC_IMPL_H_
#define CHROME_SERVICES_SPEECH_SODA_SODA_ASYNC_IMPL_H_

// This file contains the interface contract between Chrome and the Speech
// On-Device API (SODA) binary. Changes to this interface must be backwards
// compatible since the SODA binary on the device may be older or newer than the
// Chrome version.

extern "C" {

RecognitionResultHandler;
SerializedSodaEventHandler;

SodaConfig;

SerializedSodaConfig;

void* CreateSoda(SerializedSodaConfig config);

// Destroys the instance of SODA, called on the destruction of the SodaClient.
void DeleteSodaAsync(void* soda_async_handle);

// Feeds raw audio to SODA in the form of a contiguous stream of characters.
void AddAudio(void* soda_async_handle,
              const char* audio_buffer,
              int audio_buffer_size);
}

#endif  // CHROME_SERVICES_SPEECH_SODA_SODA_ASYNC_IMPL_H_