I am trying to include Google speech api in my unity app.
I have followed all the steps in the api documentation for c# https://cloud.google.com/speech-to-text/docs/quickstart-client-libraries#client-libraries-install-csharp . I installed this package "Install-Package Google.Cloud.Speech.V1 -Pre" through NuGet package manager but no google references are being shown. This results to the error "The type or namespace name 'Google' could not be found (are you missing a using directive or an assembly reference?)". I checked these possible duplicates but to no avail "The type or namespace name 'Google' could not be found", "The type or namespace could not be found". Switching platform within unity from android to windows shows the google references but without resolving the error.
using Google.Cloud.Speech.V1;
using System;
namespace GoogleCloudSamples
{
public class SpeechGoogle
{
public static void Main(string[] args)
{
var speech = SpeechClient.Create();
var response = speech.Recognize(new RecognitionConfig()
{
Encoding = RecognitionConfig.Types.AudioEncoding.Linear16,
SampleRateHertz = 16000,
LanguageCode = "en",
}, RecognitionAudio.FromFile("audio.raw"));
foreach (var result in response.Results)
{
foreach (var alternative in result.Alternatives)
{
Console.WriteLine(alternative.Transcript);
}
}
}
}
}
The error occurs from the first code line "using Google.Cloud.Speech.V1;". Is it possible that unity cannot support google cloud services or am I missing a step?