Microsoft TTS not working - Weird error message

I tried setting up Microsoft TTS as the Dutch neural voice is a lot better than Google.

When I try

I get the following errors:

TSS config is

Screenshot 2020-08-22 at 18.18.07

I am having the same problem using neural voices, did you find a solution?

No, I couldn’t get it to work unfortunately.

Are you using TSL connection?
I had the same problem, when I used a http URL it worked but with https it didn’t.
But if you add base_url to tts then it works (at least for me)

Could you share your yaml config?

tts:
  - platform: google_translate
    language: 'sv'
    base_url: https://yourDNS-URL.duckdns.org:8123

Same problem here - not able to synthesize Dutch TTS with the Microsoft engine. This config is working when selecting AriaNeural without changing language or gender:

  - platform: microsoft
    cache: false
    api_key: <HIDDEN>
    region: westeurope
    type: AriaNeural

This one fails, keeps the default language (en-us) but changes gender and voice:

  - platform: microsoft
    cache: false
    api_key: <HIDDEN>
    region: westeurope
    gender: Male
    type: GuyNeural

And this one fails as well (change of language and voice type, but keeping gender to default):

  - platform: microsoft
    cache: false
    api_key: <HIDDEN>
    region: westeurope
    language: nl-nl
    type: ColetteNeural

Using the same parameters in Python with the test script and the latest version of pycsspeechtts all combinations are working correctly (WAV file is created). I’m not that experienced with Python, Docker and Linux so I was unable to check which version pycsspeechtts is included in 117.1. Could it be there’s an older version included of pycsspeechtts? Or is there a bug in the ā€˜Microsoft’ TTS integration code?

1 Like

Thanks for the investigation. You could have a look at github and see who created it and contact them or file a bug report.

Thanks for the suggestion. It took me a few hours to find out how I could debug this, but finally succeeded in finding the issue and resolving it. I hope I submitted my first bug in GitHub correctly at https://github.com/home-assistant/core/issues/42809.

1 Like

Your issue report made me dig into this issue too (as I was having this issue too) and verify that your investigation was spot on :slight_smile:
I’ve requested the owner of the package needed for this to release a new version:

1 Like

PR for merging into HA (maybe 0.118):

1 Like

Hello, i have the same issue. Any news ? How can i fix it for now? :confused:
I have the HA 0.118.4

Tryed to update manually with

pip install git+https://github.com/prairiesnpr/pycsspeechtts.git --upgrade --force-reinstall

But still not working… :frowning:

It is already in since 0.118.0. What is your exact error and config?

Did you set up both the language and voice type?

Hello Hmmbob,

There is my configuration, i have tryed a lot of changes, with and without some config values and the result is same.

tts:
  - platform: microsoft
    api_key: 
    region: francecentral
    language: fr-fr
    type: DeniseNeural

The only way i found to make it work was with this configuration =>

tts:
  - platform: microsoft
    api_key: 
    region: francecentral

Here is my two logs =>

Logger: homeassistant.components.tts
Source: components/tts/__init__.py:172
Integration: Text-to-Speech (TTS) (documentation, issues)
First occurred: 20:08:23 (2 occurrences)
Last logged: 20:08:27

Error on init TTS: No TTS from microsoft for 'test'
Logger: pycsspeechtts.pycsspeechtts
Source: /usr/local/lib/python3.8/site-packages/pycsspeechtts/pycsspeechtts.py:68
First occurred: 20:08:23 (2 occurrences)
Last logged: 20:08:27

Text synthesis failed, statuscode 400, reason:

francecentral doesn’t support neural voices. Try another region (i.e. westeurope (=Netherlands)). You will need to create a new resource there though.

See https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/regions#standard-and-neural-voices

1 Like

It’s worked !
Can’t believe that Microsoft limit the neural tts to some regions…
I didn’t seen any infos about that…

Thank you for your help, your awesome :wink:

You’re welcome.

I think it’s related to capacity or specific hardware needed or so. Glad it worked :slight_smile:

I’ll probably put in a PR to specify this better in the docs.

1 Like

And done, it’s in the docs now/soon:

1 Like

It took me some trials to make it working.
What I got wrong was how to use the voice name, for example en-US-AriaNeural.
It turns out that you need to split it yourself like this:

language: en-us # note that is all lowercase
type: AriaNeural

Hope it helps.

6 Likes