【问题标题】:Cognitive services. Azure endpoint not working认知服务。 Azure 端点不工作
【发布时间】:2019-05-08 16:59:12
【问题描述】:

我集成了 Microsoft Cognitive Services 的 Speech to Text 的 30 天免费试用。

var config = SpeechConfig.FromSubscription("fake", "westus");

   using (var recognizer = new SpeechRecognizer(config))
      {
        lock (threadLocker)
        {
            waitingForReco = true;
        }

        var result = recognizer.RecognizeOnceAsync().Result;

        string newMessage = string.Empty;
        if (result.Reason == ResultReason.RecognizedSpeech)
        {

            newMessage = result.Text;
        }
        else if (result.Reason == ResultReason.NoMatch)
        {
            newMessage = "NOMATCH: Speech could not be recognized.";
        }
        else if (result.Reason == ResultReason.Canceled)
        {
            var cancellation = CancellationDetails.FromResult(result);
            newMessage = $"CANCELED: Reason={cancellation.Reason} ErrorDetails={cancellation.ErrorDetails}";
        }

        lock (threadLocker)
        {
            message = newMessage;
            waitingForReco = false;
        }
    }

当我使用免费的演示密钥连接到 api 时,它可以工作。当我在 Azure 中创建 Azure 认知服务时,它总是返回 Canceled。

我必须为此演示密钥和生产密钥配置其他差异吗?

【问题讨论】:

    标签: c# azure unity3d speech-to-text azure-cognitive-services


    【解决方案1】:

    我认为您可能创建了错误的服务。对于认知服务,有很多类型,比如face、luis、speechservice等等。在这种情况下,您需要在Azure门户上创建资源时通过搜索语音来创建语音服务。

    希望对你有帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-17
      • 1970-01-01
      • 2020-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-02
      • 1970-01-01
      相关资源
      最近更新 更多