登录
首页 >  Golang >  Go问答

Azure TTS 失败: WS_OPEN_ERROR_UNDERLYING_IO_OPEN_FAILED

来源:stackoverflow

时间:2024-02-06 10:33:22 374浏览 收藏

大家好,我们又见面了啊~本文《Azure TTS 失败: WS_OPEN_ERROR_UNDERLYING_IO_OPEN_FAILED》的内容中将会涉及到等等。如果你正在学习Golang相关知识,欢迎关注我,以后会给大家带来更多Golang相关文章,希望我们能一起进步!下面就开始本文的正式内容~

问题内容

运行 golang 版本的快速入门:将文本转换为语音时,出现此错误。

synthesis started.


canceled: reason=1.
canceled: errorcode=5
canceled: errordetails=[connection failed (no connection to the remote host). internal error: 1. error details: failed with error: ws_open_error_underlying_io_open_failed
wss://westus.tts.speech.microsoft.com/cognitiveservices/websocket/v1
x-connectionid: 02f16471298847bb89fcebf5a3d474cc usp state: sending. received audio size: 0 bytes.]
canceled: did you set the speech resource key and region values?

在此登录。

此外,通过 spx cli 的语音服务也失败,但 spx cli 不是我主要关心的问题。相反,这是为了表明问题的普遍性。

$ spx synthesize --text "Enjoy using the Speech CLI." --audio output my-sample.wav  
SPX - Azure Speech CLI, Version 1.29.0
Copyright (c) 2022 Microsoft Corporation. All Rights Reserved.

  audio.output.file=my-sample.wav
  audio.output.type=file
  diagnostics.config.log.file=log-{run.time}.log
  service.config.key= 1ef5****************************
  service.config.region=eastus
  synthesizer.input.text=Enjoy using the Speech CLI.
  synthesizer.input.type=text
  x.command=synthesize
  x.input.path=@none

SYNTHESIS STARTED: ca5354d966964c15b0c1630c601535a9

CANCELED: Reason=Error
CANCELED: ErrorCode=ConnectionFailure
CANCELED: ErrorDetails=Connection failed (no connection to the remote host). Internal error: 1. Error details: Failed with error: WS_OPEN_ERROR_UNDERLYING_IO_OPEN_FAILED
wss://eastus.tts.speech.microsoft.com/cognitiveservices/websocket/v1
X-ConnectionId: cbaf9bdda02c42c796fef1bdd071bbf9 USP state: Sending. Received audio size: 0 bytes.
CANCELED: Did you update the subscription info?

详情

  • 操作系统:ubuntu 22.04.2 lts
  • 编程语言:golang(尽管我给出的第二个示例也是命令行)。
  • 客户端:本地主机
  • 家庭网络,位于美国
  • 是的,我检查了我该死的 azure 资源密钥和区域值。
  • 是的,我检查了 azure 语音服务本身(状态:活动)
  • 是的,我在不同的区域创建了新的 azure 语音服务。请注意第一个示例中的 westus 和第二个示例中的 eastus 。这不起作用(由这篇 github 帖子建议)。

我在我的主要工作笔记本电脑上遇到了这个问题。我的 golang 代码和 spx(命令行)都可以在我的另一台笔记本电脑上运行。


正确答案


您看到的错误消息表明打开服务的网络连接时出现问题。这可能与您的配置或网络问题有关。理想情况下,我们需要 sdk 日志才能正确诊断您遇到的问题。您可以通过关注these instructions启用日志记录

但是,鉴于您使用的是 ubuntu 22.04,我大胆猜测您缺少一些依赖项。首先仔细检查您是否安装了最低限度的依赖项:

sudo apt-get update
sudo apt-get install build-essential libssl-dev ca-certificates libasound2 wget

您也可能没有安装正确版本的 openssl 库。认知服务语音 sdk 仍使用 openssl 1.1.1,但 ubuntu 22.04 已迁移到 openssl 3.0。您可以通过从命令行运行 openssl version 来确认您拥有哪个版本。这里有两个选项:

  • 您可以尝试强制安装旧版 1.1.1f libssl:
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb

终于介绍完啦!小伙伴们,这篇关于《Azure TTS 失败: WS_OPEN_ERROR_UNDERLYING_IO_OPEN_FAILED》的介绍应该让你收获多多了吧!欢迎大家收藏或分享给更多需要学习的朋友吧~golang学习网公众号也会发布Golang相关知识,快来关注吧!

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>