[英]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.