synesthesiam / docker-mozillatts

Docker image for Mozilla TTS server
MIT License
183 stars 36 forks source link

MaryTTS-compatible /process endpoint issue with Home Assistant #8

Closed mikeygnyc closed 3 years ago

mikeygnyc commented 3 years ago

I'm experiencing a bit of an issue with Home Assistant calling the MaryTTS API. Right now I do get a wave file output from the server but it appears to be concatenating all the input parameters as the string to synthesize. HA appears to want to use the POST method so if I were to try and have HA speak "Hello", it would actually speak "INPUT_TEXT=Hello&INPUT_TYPE=TEXT&OUTPUT_TYPE=AUDIO&LOCALE=en_US&AUDIO=WAVE_FILE&VOICE=cmu-slt-hsmm". I'm not sure if this is an HA config issue or a server config issue. Right now my HA config for tts looks something like this:

tts:
  - platform: marytts
    port: 59125
    host: [redacted]
    base_url: https://[redacted]:8123
xBelladonna commented 3 years ago

I'm also experiencing the same problem. It seems like Home Assistant is sending a POST request, but with URL-encoded parameters as the payload. According to the code under the /process endpoint, the text is obtained by simply getting the POST data as a string and feeding that to the synthesizer function, which would probably work if HA was sending a GET request with this payload. The line in the library HA uses to send the request is here. We would need to update the code to decode the URL-encoded POST payload for it to work properly.

synesthesiam commented 3 years ago

Docker images have been updated with the pull request from @xBelladonna (thanks!)

Please re-open issue if there are more problems.