我能够在Unity3D项目中安装Google Speech API。我正在UWP平台上开发(为Hololens开发)
private static async Task<object> StreamingRecognizeAsync(string filePath)
{
var speech = SpeechClient.Create();
var streamingCall = speech.StreamingRecognize();
// Write the initial request with the config.
await streamingCall.WriteAsync(
new StreamingRecognizeRequest()
{
StreamingConfig = new StreamingRecognitionConfig()
{
Config = new RecognitionConfig()
{
Encoding =
RecognitionConfig.Types.AudioEncoding.Linear16,
SampleRateHertz = 16000,
LanguageCode = "en",
},
InterimResults = true,
}
});
return null;
}
当我添加此处https://cloud.google.com/speech-to-text/docs/streaming-recognize#speech-streaming-recognize-csharp
提及的代码段时它抛出一个错误The type 'ServiceEndpoint' is defined in an assembly that is not referenced. You must add a reference to assembly 'Google.Api.Gax.Grpc, Version=2.9.0.0, Culture=neutral'.
我点击了AddReference
,但它没有任何改变。我该怎么办?我是第一次遇到这类问题。