1

When running the Golang version of Quickstart: Convert text to speech, this error appears.

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.

Furthermore, Speech Service via spx cli also fails, but spx cli is not my main concern. Rather, this is to show how general the problem is.

$ 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?

Particulars

  • OS: Ubuntu 22.04.2 LTS
  • Programming Language: Golang (though also command line with the second example I gave).
  • Client: localhost
  • Home network, located in the U.S.
  • Yes, I checked my bloody Azure resource key and region value.
  • Yes, I checked the Azure Speech Service itself (Status: Active)
  • Yes, I made a new Azure Speech Service in a different region. Note westus in the first example and eastus in the second example. That didn't work (suggested by this github post).

I am facing this problem on my main work laptop. Both my Golang code and SPX (command line) work on my other laptop.

1 Answers1

0

The error message you are seeing is indicating that there is something going wrong with opening a network connection to the service. This could be related to your configuration, or a networking issue. Ideally we'd need the SDK logs to be able properly diagnose the issue you are running into. You can enable logging by following these instructions

However, given you are using Ubuntu 22.04, I would venture a guess that you are missing some dependencies. First double check that you have the bare minimum dependencies installed:

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

You may also not have the correct version of the OpenSSL library installed. The Cognitive Services Speech SDK still uses OpenSSL 1.1.1, but Ubuntu 22.04 has moved to OpenSSL 3.0. You can confirm which version you have by running openssl version from your command line. There are two options here:

  • You can attempt to force install the older 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
Ralph
  • 101
  • 2
  • "Ideally we'd need the SDK logs to be able properly diagnose the issue you are running into. You can enable logging by following these instructions" Not to be pedantic, but I already supplied the logs with the first submission of my question. Yes, I made edits to my post, but the log link to pastebin.com was always there. Let's not lose focus though. Thanks for your answer. – user2736727 Jul 27 '23 at 11:37
  • My apologies, I missed the linked to logs. Taking a look at those, the underlying issue is DNS lookup failure since you are trying to connect to an host that doesn't exist: westus2234.tts.speech.microsoft.com Please double check the value that you are setting your subscription region to. westus is a valid region, westus2234 is not. – Ralph Jul 28 '23 at 00:07
  • No worries, mate. Again, thanks for you answer. I wish there was a "I gotta correct you but we're still in this togther!" button or something like that for the internet. I'd press it here. – user2736727 Aug 01 '23 at 06:54
  • I ended up reinstalling Ubuntu and now my code is working. I know that's not very didactic or practical for anyone in the future reading this. But, @Ralph, if you'd like to take a whack at it: why would a reinstall of Ubuntu get me into a working state again? If you'll notice in my command line outputs (not the log file), both have real endpoints (the first one being "westus", the second being "eastus"). – user2736727 Aug 01 '23 at 06:56
  • So, yes, even though I gave a previous-run's log with erroneous "west2234" entries (that was me breaking stuff on purpose), that doesn't explain why -both- my Golang code (westus) and SPX command line (eastus) were giving the same error. – user2736727 Aug 01 '23 at 06:56