我想包括在我的应用程序的统一谷歌语音API。
我遵循了C#https://cloud.google.com/speech-to-text/docs/quickstart-client-libraries#client-libraries-install-csharp API文档中的所有步骤。我安装了这个包通过NuGet包管理器“安装,包Google.Cloud.Speech.V1 - 售前”,但正在显示没有谷歌的引用。这导致的错误“的类型或命名空间名称‘谷歌’找不到(是否缺少using指令或程序集引用?)”。我检查了这些可能的重复,但无济于事“The type or namespace name 'Google' could not be found”,“The type or namespace could not be found”。内统一交换平台在Android到Windows显示谷歌的引用,但没有解决的错误。
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);
}
}
}
}
}
从第一代码线上发生了错误“使用Google.Cloud.Speech.V1;”。是否有可能统一不支持谷歌云服务还是我缺少一个步骤?
不,我们不支持统一(或Xamarin)在任何谷歌云客户端库。
我们supported platforms documentation。这有可能是基于REST的库可以团结的工作,但我们不支持,特别是身份验证方面很可能会失败,或者需要自定义代码。
需要明确的是,我们希望支持更多的平台,但整个一大堆的是参与这样做,特别是对于基于GRPC的库相当显著的人力成本,其中有一个本地代码组成部分,也是特别是在测试方面客户端平台和统一的版本。