首页 > 解决方案 > 出现 Bing Speech REST API 错误

问题描述

几天前我调用bing语音rest api时,我得到一个错误并且没有返回结果。

System.Net.WebException:远程服务器返回错误:(503)服务器不可用。在 System.Net.HttpWebRequest.GetResponse() 在 SpeechRESTSample.Program.Main(String[] args) 在 C:\Users\kaki1\Source\Repos\Cognitive-Speech-STT-ServiceLibrary\sample\SpeechRESTSample\Program.cs:第 78 行远程服务器返回错误:(503) 服务器不可用。更新的令牌。

或内部服务器错误

不提供服务?

标签: azuremicrosoft-cognitive

解决方案


如果我直接使用示例代码获取令牌,则会出现 401 错误。

FetchTokenUri更改https://api.cognitive.microsoft.com/sts/v1.0

https://{region}.api.cognitive.microsoft.com/sts/v1.0/issueToken

我们可以从此链接获取身份验证端点。

Speech to Text REST API的端点是以下格式

https://{region}.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1

我也在本地测试它,我可以使用端点获取令牌。

更多demo代码请参考this

在此处输入图像描述


推荐阅读