【发布时间】:2020-07-10 14:35:50
【问题描述】:
我正在尝试获取 Microsoft Azure Speech To Text Java 快速入门,网址为: Java Quickstart 按规定工作。
我还不能这样做。 运行代码时,Eclipse 控制台显示如下错误:
Say something...
CANCELED: Reason=Error
CANCELED: ErrorCode=ConnectionFailure
CANCELED: ErrorDetails=Connection failed (no connection to the remote host). Internal error: 1. Error details: 11002. Please check network connection, firewall setting, and the region name used to create speech factory. SessionId: 56caf94e5a9b4c499e5c78b5bd659dcf
CANCELED: Did you update the subscription info?
我已尝试在 Azure 控制台中为我的 Azure 语音资源重新生成 speechSubscriptionKey。
我使用 centralindia 作为 serviceRegion 。
- 我订阅了免费试用版。
- JDK 版本:
1.8.0_231用于 64 位。 - 操作系统:Microsoft Windows 10
- IDE:Eclipse Luna
我在使用代理服务器的网络中。我在将代理设置配置为后尝试:
System.setProperty("http.proxyHost", "<ProxyHost>");
System.setProperty("http.proxyPort", "<ProxyPort>");
还是不行。
附注:我有一个连接到系统的麦克风。
【问题讨论】:
-
请尝试
SpeechConfig.setProxy("proxyHost", "proxyPort", "", "") -
是的!这行得通。语法位于:docs.microsoft.com/en-us/java/api/…
-
嗨,我已经在答案中更新了这个问题的解决方案。你能把它标记为结束这个问题的答案吗?这可能会帮助其他遇到类似问题的人。您也可以发布自己的答案并将其标记为结束此问题。如果是这样,请告诉我,我将删除我的答案。:)
标签: java azure speech-to-text azure-speech