TTS update

MaryTTS?

I would love to see support for this, if I do I may have a public server for you guys to use!.

hello i have this configuration:

media_player:
  platform: vlc
  name: VLC

tts:
  platform: google
  cache: true
  cache_dir: /tmp/tts
  time_memory: 300

but when i updated to new version of HA i dont ear any sound on my speaker, i have it connected directly on rpi. that is my log:

17-02-19 00:59:18 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=3050450192-2>
17-02-19 00:59:18 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 2768997136: Sending {'type': 'event', 'event': {'data': {'entity_id': 'media_player.vlc', 'old_state': <state media_player.vlc=idle; media_position_updated_at=2017-02-19T00:57:28.716104+00:00, volume_level=1.0, media_content_type=music, supported_features=16909, is_volume_muted=False, friendly_name=VLC, media_duration=-0.001, media_position=0.001 @ 2017-02-19T00:57:28.731515+00:00>, 'new_state': <state media_player.vlc=idle; media_position_updated_at=2017-02-19T00:59:17.932650+00:00, volume_level=1.0, media_content_type=music, supported_features=16909, is_volume_muted=False, friendly_name=VLC, media_duration=0.0, media_position=0.0 @ 2017-02-19T00:57:28.731515+00:00>}, 'time_fired': datetime.datetime(2017, 2, 19, 0, 59, 17, 973688, tzinfo=<UTC>), 'origin': 'LOCAL', 'event_type': 'state_changed'}, 'id': 2}
17-02-19 00:59:18 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=3050450192-1>
17-02-19 00:59:18 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=media_player.vlc, new_state=<state media_player.vlc=playing; media_position_updated_at=2017-02-19T00:59:17.932650+00:00, volume_level=1.0, media_content_type=music, supported_features=16909, is_volume_muted=False, friendly_name=VLC, media_duration=0.0, media_position=0.0 @ 2017-02-19T00:59:18.808062+00:00>, old_state=<state media_player.vlc=idle; media_position_updated_at=2017-02-19T00:59:17.932650+00:00, volume_level=1.0, media_content_type=music, supported_features=16909, is_volume_muted=False, friendly_name=VLC, media_duration=0.0, media_position=0.0 @ 2017-02-19T00:57:28.731515+00:00>>
17-02-19 00:59:18 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 2768997136: Sending {'type': 'event', 'event': {'data': {'entity_id': 'media_player.vlc', 'old_state': <state media_player.vlc=idle; media_position_updated_at=2017-02-19T00:59:17.932650+00:00, volume_level=1.0, media_content_type=music, supported_features=16909, is_volume_muted=False, friendly_name=VLC, media_duration=0.0, media_position=0.0 @ 2017-02-19T00:57:28.731515+00:00>, 'new_state': <state media_player.vlc=playing; media_position_updated_at=2017-02-19T00:59:17.932650+00:00, volume_level=1.0, media_content_type=music, supported_features=16909, is_volume_muted=False, friendly_name=VLC, media_duration=0.0, media_position=0.0 @ 2017-02-19T00:59:18.808062+00:00>}, 'time_fired': datetime.datetime(2017, 2, 19, 0, 59, 18, 822724, tzinfo=<UTC>), 'origin': 'LOCAL', 'event_type': 'state_changed'}, 'id': 2}
17-02-19 00:59:18 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=media_player.vlc, new_state=<state media_player.vlc=idle; media_position_updated_at=2017-02-19T00:59:17.932650+00:00, volume_level=1.0, media_content_type=music, supported_features=16909, is_volume_muted=False, friendly_name=VLC, media_duration=0.0, media_position=0.0 @ 2017-02-19T00:59:18.955642+00:00>, old_state=<state media_player.vlc=playing; media_position_updated_at=2017-02-19T00:59:17.932650+00:00, volume_level=1.0, media_content_type=music, supported_features=16909, is_volume_muted=False, friendly_name=VLC, media_duration=0.0, media_position=0.0 @ 2017-02-19T00:59:18.808062+00:00>>
17-02-19 00:59:18 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=3050450192-4>
17-02-19 00:59:19 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 2768997136: Sending {'type': 'event', 'event': {'data': {'entity_id': 'media_player.vlc', 'old_state': <state media_player.vlc=playing; media_position_updated_at=2017-02-19T00:59:17.932650+00:00, volume_level=1.0, media_content_type=music, supported_features=16909, is_volume_muted=False, friendly_name=VLC, media_duration=0.0, media_position=0.0 @ 2017-02-19T00:59:18.808062+00:00>, 'new_state': <state media_player.vlc=idle; media_position_updated_at=2017-02-19T00:59:17.932650+00:00, volume_level=1.0, media_content_type=music, supported_features=16909, is_volume_muted=False, friendly_name=VLC, media_duration=0.0, media_position=0.0 @ 2017-02-19T00:59:18.955642+00:00>}, 'time_fired': datetime.datetime(2017, 2, 19, 0, 59, 18, 956290, tzinfo=<UTC>), 'origin': 'LOCAL', 'event_type': 'state_changed'}, 'id': 2}
17-02-19 00:59:19 INFO (MainThread) [homeassistant.components.http] Serving /api/tts_proxy/2e6f9b0d5885b6010f9167787445617f553a735f_en_-_google.mp3 to 192.168.1.89 (auth: False)

i am running hassbian toybox.

@masterkenobi on this case… if i want ear the sound more high, how can i do?

Im not sure what you mean. Im using Google TTS and it is clear enough for me.

but did you use amplifier speakers directly on RPI?
i am thinking of buying this https://pt.aliexpress.com/item/Car-FM-USB-3-5mm-Transmitters-Transmite-wireless-Audio-Transmitter-Stereo-Dongle-Adapter-for-iPhone-iPad/32740098600.html?spm=2114.02010208.8.42.Rr113v to use in my bed room, because i have the PI in my living room, do you think it will work?

Now i have a amplifier speakers connected direclty on my pi, but i would like to hear the loudest sound, i dont know how to increase the volume.

Yes. The speaker is powered separately. I believe any speaker that have input via 3.5mm jack will work. The quality of the sound depend on the speaker.

I have no idea. I never tried it. Let me know if it works. I am interested in this also.

Try alsamixer command via SSH to increase the volume in your Pi.

ok i will try, thanks for the tip. when you share your config home automation? i am very interesting in your ideas :wink:

I have used these sort of FM transmitters in the past - they are a great way to distribute sounds around the house.

However, for TTS, I assume you need a system that is always on.

This would mean you need to have the FM transmitter always on as well as FM radio(s) on and tuned to the frequency of the FM transmitter. It also means you would need to be constantly charging the battery for the FM transmitter (I am not sure if it is capable of being changed and used at the same time).

This is the dilemma for TTS for me - you need an amplifier and system always on waiting for something to say - or be able to turn on your system, wait for it to come alive, then say your TTS. Not impossible, but a little more involved.

Maybe I just talked myself into an echo?! :wink:

1 Like

phileep
Thank you for your attention.
Having the transmitter always on will be no problem for me.
What I do not know is if the transmitter is being used while charging.
However, I’m going to buy it to buy it.
It is not for 3 euros that I get poorer.

And yes I have to always have the fm receiver turned on, but for what I want I create an automation to connect it a few seconds before.

Or do you know an alternative to using this with cheap bluetooth speakers?

@Joe_Stan1
I had the same problem (playing from pi with local speaker) and just found the solution, change and/or add “arguments” and set hw:0,0 instead of example 1,0

media_player:
  - platform: vlc
    name: speaker_1
    arguments: '--alsa-audio-device=hw:0,0'

the permissions should also be set as you did and i still get that error in the log but now it plays from hass also.

2 Likes

Same here. Running HA in a Docker container behind an Nginx reverse proxy, so no certs listed in HA config. I had carried over some of my old config from a previous install with the base_url. Couldn’t get it working at all until I commented out the base_url. Now it works like a charm.

So I am having trouble getting TTS to work as well. I am using duckdns and letsencrypt so I have added

http:
  base_url: https://something.duckdns.org

Also in the tts file I have this:

- platform: google
  cache: true
  cache_dir: /home/mgranger/.homeassistant/tts/
  time_memory: 300

When I use home-assistant to play the file on my TV, Google Home, or Chrome device I can see something is loaded onto the tv because it acts like it trys to play a file however there is no sound. When I navigate to the tts folder there is an audio file that when I play I am able to hear the words on a different computer than the one running my home-assistant. I just don’t have speakers hooked up to this one so I don’t know if it works It tries to open it up in parole on my home-assistant computer but nothing plays but in VLC it appears to work. Would switching my default to VLC fix the issue?

I had an issue with a Chromecast (I didn’t kept the Chromecast and didn’t have time to find a work-around) with TTS. As far as I understand, HASS is telling the Chromecast to play https://something.duckdns.org/a/tts/internal/path/tts_file.mp3. Your Chromecast is trying to resolve something.duckdns.org with Google’s DNS, which are telling it your public IP address. In my case, I have a router in front of my network doing some NAT translations. However, when a request comes from the local network, the router doesn’t make the NAT translation, and tries to handle the request itself. So the Chromecast ended up trying to load https://my-router/a/tts/internal/path/tts_file.mp3 - which obviously doesn’t exist. Even if my DHCP server gives a local DNS address to work around this issue on other devices of my LAN, the Chromecast didn’t seem to honor it.

I don’t know if it’s the same issue as you’re facing, but maybe it can help you to find a solution.

There is a way to turn a Raspberry Pi into a FM transmitter. http://www.instructables.com/id/Raspberry-Pi-Radio-Transmitter/
I don’t know how it would work while HA is running at the same time, but it might be worth a shot.

I was actually thinking that one could do this, and have FM radios throughout the house tuned to the same station, and one could control what’s playing through HA. Or perhaps one could change the station through HA to change which radio sound is played through.

I don’t know how this would work for the purposes of TTS. Just another idea.

To add on this: the Google Home has the same DNS issue. As a fix, I blocked all traffic from and to the Google Home local IP for the port 53 (DNS) on the router. It uses my local DNS (provided by the DHCP) as a fallback, and everything works great.

2 Likes