Unity3D:类型'ServiceEndpoint'在未引用的程序集中定义。您必须添加对程序集“ Google.Api.Gax.Grpc”的引用

时间:2019-11-21 19:59:23

标签: c# unity3d google-cloud-platform grpc google-speech-api

我能够在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'.

enter image description here

我点击了AddReference,但它没有任何改变。我该怎么办?我是第一次遇到这类问题。

0 个答案:

没有答案