简体   繁体   English

认知服务。 Azure终结点无法正常工作

[英]Cognitive services. Azure endpoint not working

I integrated the 30 days free trial of the Speech to Text of Microsoft Cognitive Services. 我集成了Microsoft认知服务文本语音的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;
        }
    }

When i connect to the api with the free demo key it works. 当我使用免费的演示密钥连接到api时,它将起作用。 When i create an Azure Cognitive Service in Azure it always returns Canceled. 当我在Azure中创建Azure认知服务时,它始终返回已取消。

Are there any other differences i have to configure for this demo key and a production key? 我必须为此演示密钥和生产密钥配置其他任何区别吗?

I think you might created the wrong service. 我认为您可能创建了错误的服务。 For cognitive services, there are many types, such as face, luis, speechservice and so on. 对于认知服务,有很多类型,例如面部,路易斯,语音服务等。 In this case, you need to create a speech service by searching speech when you create a resource on azure portal. 在这种情况下,您需要在Azure门户上创建资源时通过搜索语音来创建语音服务。

在此处输入图片说明

在此处输入图片说明

Hope it helps! 希望能帮助到你!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何检查 Azure 视觉认知服务 OCR 订阅密钥和端点值是否有效? - How to check the Azure vision Cognitive services OCR subscription key and endpoint value is valid or not? Azure认知服务{body}示例 - Azure Cognitive services {body} example Azure 认知服务 - 语音转文本:未检测到麦克风 - Azure Cognitive Services - Speech to text: Microphone not detected Azure 认知服务无法在生产模式下工作 - Azure Cognitive Service not working on production mode Azure 认知服务 - 文本转语音 - SpeakTextAsync 不返回 - Azure Cognitive Services - Text-to-Speech - SpeakTextAsync does not return 我可以从 Azure 认知服务中检索已识别的置信度吗? - Can I retrieve the confidence of the recognized from Azure Cognitive Services? Azure认知服务Xamarin.Forms访问问题 - Azure Cognitive Services Xamarin.Forms access problem Xamarin表格和Azure认知服务:文字服务语音不起作用 - Xamarin forms & Azure cognitive services : Speech to text service does not work Azure 认知服务 TTS - 示例应用中其他语言的错误 - Azure Cognitive Services TTS - an error for other language in sample app Azure 认知服务计算机视觉在 QA 中失败,但在开发中完美运行 - Azure Cognitive Services Computer Vision fails in QA but works perfectly in dev
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM