【问题标题】:Microsoft Azure Speech to Text Java issue: ConnectionFailure when using proxyMicrosoft Azure Speech to Text Java 问题:使用代理时出现 ConnectionFailure
【发布时间】: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


【解决方案1】:

感谢 Daud 的评论。

 SpeechConfig.setProxy("proxyHost", "proxyPort", "", "")

更多详情可以参考这个link

【讨论】:

    猜你喜欢
    • 2020-03-10
    • 2021-01-31
    • 2019-05-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多