Volumio & Text to Speech

Hi all!

I’m having difficulties setting up Text to Speech with Volumio.

I’ve set up Amazon Polly. TTS-files are generated. Volumio is running. It can play music. I can interact with Volumio through Home Assistant (play, pause, volume, etc.).

Volumio can also play the TTS-files generated by Polly if I feed them to Volumio by hand. As in: starting radio and linking it to ‘https://[url-redacted]:8123/api/tts_proxy/aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d_en-us_42023311789_amazon_polly.mp3’

For Volumio to play these files, I did have to turn on audio resampling in Volumio and set bit depth to 32, and sample rate to 44.1 kHZ.

Now, when I try to use TTS with automations, or the media instance in Home Assistance, I hear absolutely nothing. (Not even some crackling, which I hear when I play non-resampled files in Volumio by hand.)

There is a media player related error in my logs whenever I try to use TTS in Home Assistance, but I am not able to interpret it. From my logs:

2017-10-15 11:41:55 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/tasks.py", line 181, in _step
    result = coro.throw(exc)
  File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 1025, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/media_player/__init__.py", line 408, in async_service_handler
    yield from getattr(player, method['method'])(**params)
  File "/usr/lib/python3.6/asyncio/futures.py", line 331, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/media_player/__init__.py", line 707, in play_media
    raise NotImplementedError()
NotImplementedError

Does anyone have any experience with setting up TTS and Volumio? Thanks!

The error message is a message that the functionality hasn’t yet been implemented. In other words - it’s a ‘no way’ - sadly.

1 Like

Volumio includes MPD which does support TTS. In HA, setup a new media player following the MPD instructions and point it to your Volumio device.

I’m not getting this to work unfortunately. Is there somethings I can check to verify?

I see the volumio server has the mpd port 6600 listening.

UPDATE: I was able to accomplish this using the method outlined here

Sorry for graveyarding:

# Volumio
media_player:
  - platform: volumio
    name: volumio
    host: 1.2.3.4
    port: 3000

  - platform: mpd
    name: volumio_mpd
    host: 1.2.3.4

This works for me to let volumio speak. Actually as volumio is a standard product, wouldn’t it be possible to implement this workaround into the volumio component itself to make TTS requests adressing its MPD component?

7 Likes

Not working for me. Unless… Is there a reason for your naming convention or is that just for organization? (volumio_mpd)

That’s working for me. Thanks!

Hello,

I’ve done the same, looks like it’s working, but when I try to “say” something thru Volumio MPD it looks like it’s going go “say”, but stops and comes back to playback, most of times I can hear the start of the frase but nothing more… It looks like it plays 1-2 secs of the TTS and comes back to music playback. If I have longer frases it’s the same. I’ve checked the files on TTS folder and they are there and plays OK in windows player…
What can be wrong?

Thanks!

Worked like a charm, easy way to get TTS to any speaker.

Good job! working for me. Thanks you

yep is working also for me!thanks!

Have to add this lines to configuration.yaml?

Just found this topic and tested on my instance. TTS as such works perfectly fine from the first try… thoiugh there is small issue here… after the text is spoken, volumio player start to play music, even if previously it was paused.
If the music is played, it is stopped, text is spoken and playback resumes… from the beginning of the next track in the queue…Any way to have better control over this that have some automation to cover entire process? E.g. something like checking if somethign isplayed and what it is, speaking, restoring playback or stopping it instantly?