azure - 出现 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) 服务器不可用。更新的令牌。
或内部服务器错误
不提供服务?
解决方案
如果我直接使用示例代码获取令牌,则会出现 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。
推荐阅读
- python - 仅列出最具体的代码
- database - 微服务和语言资源包
- xcode - 在 Swift 包中创建自定义标头。Swift 包中不存在 IDETemplteMacros.plist
- python - 美丽的汤 - 将带有许多空格字符的文本放入 datafame
- components - Angular中的Ag-Grid cellRenderer单击事件
- latex - 是否可以根据 TikZ 的维恩图代码为 r 考试创建一个问题?
- flutter - 避免在 Setstate() Flutter 上重新加载 Listview
- c++ - 具有自定义比较器和 O(n) 时间的 priority_queue c++
- import - 如何覆盖实体类以向导入类型的下拉列表添加新选项?PrestaShop 1.7
- sql-server - SQL 将字符串拆分为列