I upgraded from 0.104.3 to 0.105.5 yesterday, and today discovered that my MaryTTS announcements to my Sonos speaker are not working. I know that there were changes to MaryTTS in this release, but reading the docs, my config is fine. I’m running HA Supervised (formerly Hass.io) on an older NUC running Ubuntu 18.04, and have this MaryTTS image running in Docker: https://hub.docker.com/r/sliversniper/marytts (installed via the Portainer add-on). This is my MaryTTS config entry:
tts:
platform: marytts
host: 172.17.0.2
I use the following script in some automations, and it all worked fine up until yesterday.
Today, I can click on my media player in the front end, type in a message, and hear the TTS on my Sonos. But if I go to services and try to use tts.marytts_say, or run the script above (which is using the same service), I get the following error:
2020-02-23 13:22:38 ERROR (SyncWorker_7) [homeassistant.components.sonos.media_player] Error on play_media with UPnP Error 714 received: Illegal MIME-Type from 192.168.0.125
That IP is my Sonos speaker. I think the issue may be that the new TTS files end with .wave_file, whereas they used to end with .wav, and the media player isn’t handling this, but I’m not sure.
I’d really appreciate any help to get my TTS announcements on my Sonos working again. Thanks in advance!
No, I have an issue open on GitHub but there hasn’t been any action on it. I really miss having TTS working in HA - it worked great until the changes to the platform in 0.105. As far as I know MaryTTS is the only self-hosted option available at the moment, but maybe there aren’t enough people using it to make it a priority for the devs.
If you want a quick fix until your issue is resolved, you can change the file /srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/tts/__init__.py
The following line filename = f"{key}.{extension}".lower()
to filename = f"{key}.wav".lower()
However this might break other tts services.
I would like to have this fixed, but I am not sure wether they accept a pull request just for that.
How are the Integrations maintained in Home Assistant?
Thanks very much for your comment. I’m running HA Supervised on an Ubuntu host (formerly Hass.io), so I don’t think I can access/edit that file - someone tell me if I’m wrong. Otherwise I’d do it - I’m not using any other TTS.
You could try a PR. I filed an issue I filed on GitHub here, but it’s not getting much activity:
hi @darioce,
are you running HA via Docker?
I don’t have anything under /srv on my host system, does this file need to be modified on the docker image?
The above changes only work if you are using the virtual environment.
It is a bit trickier to do it with docker.
But you can try to start a bash inside the container using
Thanks a lot @darioce… unfortunately this didn’t work for me, though I can confirm the changes persisted after homeassistant restart.
I can confirm the files are now named correctly (ending with the .wav extension), but still getting the same error in the developer logs stating ‘error on Load tts: Wrong tts file format!’
before making this change the audio was playing via the localhost:59125 mary tts web interface. now even that is not working.
will wait for the your fix to get incorporated, hopefully that’ll resolve the issue.
I have to get myself accustomed to the test framework. Planning to be done this weekend, but not sure whether I manage to meet the dev’s standards on the first try
@darioce Not trying to be pushy…just wanted to let you know that issue was going to be marked as stale on GitHub so I have added a comment to say that it is still an open issue. Were you able to get anywhere with the test framework?