gpt4 book ai didi

Azure 语音文本转语音 (TTS) 失败并显示 WS_OPEN_ERROR_UNDERLYING_IO_OPEN_FAILED

转载 作者:行者123 更新时间:2023-12-03 00:17:28 29 4
gpt4 key购买 nike

当运行 Quickstart: Convert text to speech 的 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?

Log here.

此外,Speech Service via spx cli also fails ,但 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 资源 key 和区域值。
  • 是的,我检查了 Azure 语音服务本身(状态:事件)
  • 是的,我在不同的区域创建了新的 Azure 语音服务。请注意第一个示例中的 westus 和第二个示例中的 eastus。这不起作用(由 this github post 建议)。

我在我的主要工作笔记本电脑上遇到了这个问题。我的 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,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76726532/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com