- Home /
Oculus Quest Speech to Text API/SDKs that work
I am an amateur Unity programmer currently teaching myself how to work with speech-to-text API. Though I have had no difficulty implementing the various SDK/APIs available (Google Cloud Speech-to-Text API, Watson, Light Buzz, etc.) to work on the Rift, Windows, iOS, I can't figure out how to implement it on the Oculus Quest.
The furthest I have gotten on the Quest is with the Google API, but the Quest fails when it attempts to SpeechClient.Create(); Any input would be greatly appreciated or recommendations for other ways of implementing Speech Recognition on the Quest
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using UnityEngine.Audio;
using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
using Google.Cloud.Speech.V1;
using Grpc.Core;
public class googleTest : MonoBehaviour
{
public static string DEMO_FILE = "Assets/commercial_mono.wav";
private const string CredentialFileName = "gcp_credentials.json";
public Text output;
void Awake()
{
string credentialsPath = Path.Combine(Application.streamingAssetsPath, CredentialFileName);
if (!File.Exists(credentialsPath)) {
Debug.LogError("Could not find StreamingAssets/gcp_credentials.json. Please create a Google service account key for a Google Cloud Platform project with the Speech-to-Text API enabled, then download that key as a JSON file and save it as StreamingAssets/gcp_credentials.json in this project. For more info on creating a service account key, see Google's documentation: https://cloud.google.com/speech-to-text/docs/quickstart-client-libraries#before-you-begin");
return;
}
}
public void runGoogleTemp(){
Environment.SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS", credentialsPath);
var speech = SpeechClient.Create();
var response = speech.Recognize(new RecognitionConfig(){
Encoding = RecognitionConfig.Types.AudioEncoding.Linear16,
LanguageCode = "en",
}, RecognitionAudio.FromFile(DEMO_FILE));
foreach (var result in response.Results){
foreach (var alternative in result.Alternatives){
output.text = output.text+"\n"+alternative.Transcript;
Debug.Log(alternative.Transcript);
}
}
}
}
Did you ever find a decent option for quest speech to text?
Your answer
Follow this Question
Related Questions
Speech to text 3rd party Libraries - Kaldi or Pocketsphinx? 1 Answer
How to recognize a blowing sound and distinguish it from speech? 1 Answer
Windows speak recognition only partially working, is there a limit set to the number of phrases? 0 Answers
How to use custom TensorFlow speech recognition model in Unity3d? 0 Answers