blob: 52003edc8f0925f1cbe3121fd3b99c72defe618a [file] [log] [blame]
// 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.
#ifndef COMPONENTS_SODA_SODA_UTIL_H_
#define COMPONENTS_SODA_SODA_UTIL_H_
#include <string>
#include "media/mojo/mojom/speech_recognizer.mojom.h"
namespace speech {
// Returns whether the Speech On-Device API is supported in
// Chrome. This can depend on e.g. Chrome feature flags, platform/OS, supported
// CPU instructions.
bool IsOnDeviceSpeechRecognitionSupported();
// Returns the on-device speech recognition availability status via SODA for a
// given language code (i.e. "en-US"). Speech recognition considered available
// if the Speech On-Device API is supported and the language pack for the
// corresponding language is installed. This utility function must be run in the
// browser process.
media::mojom::AvailabilityStatus GetSodaAvailabilityStatus(
const std::string& language);
} // namespace speech
#endif // COMPONENTS_SODA_SODA_UTIL_H_