Hi there guys,
I’m trying to use the Google TTS to make my smart rabbit talk but I’m not sure if it’s possible.
I know that every time I use the Google TTS, the component creates a MP3 file located in a directory we can set on declaring the component, so my TTS configuration is like
tts:
- platform: google
cache: true
cache_dir: /config/www/vl/voice
Now, I can play audio files on the rabbit using shell commands like:
shell_command:
nab_talk: curl http://smartrabbitip/play?u=http://homeassistantip:8123/local/vl/voice/generatedbygooglefile.mp3
So, my only problem right now is:
How can I get the name of the file generated by the Google TTS?
Usually those files have names like “f1e5cc9b91711e1c95a3e32c8d3f716324cdbc63_it_-_google.mp3” but I have no idea on how to get the file name.
If I look at the logger there I can see this:
2018-01-21 12:10:00 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=media_player, service=play_media, service_data=media_content_id=http://hassioserver.duckdns.org:8123/api/tts_proxy/f1e5cc9b91711e1c95a3e32c8d3f716324cdbc63_it_-_google.mp3, media_content_type=music, entity_id=['media_player.nabaztag'], service_call_id=1965747120-71>
2018-01-21 12:10:00 DEBUG (MainThread) [homeassistant.components.api] STREAM 1913695816 FORWARDING <Event call_service[L]: domain=media_player, service=play_media, service_data=media_content_id=http://hassioserver.duckdns.org:8123/api/tts_proxy/f1e5cc9b91711e1c95a3e32c8d3f716324cdbc63_it_-_google.mp3, media_content_type=music, entity_id=['media_player.nabaztag'], service_call_id=1965747120-71>
2018-01-21 12:10:00 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1965747120-71>
2018-01-21 12:10:00 DEBUG (MainThread) [homeassistant.components.api] STREAM 1913695816 WRITING data: {"event_type": "call_service", "data": {"domain": "media_player", "service": "play_media", "service_data": {"media_content_id": "http://hassioserver.duckdns.org:8123/api/tts_proxy/f1e5cc9b91711e1c95a3e32c8d3f716324cdbc63_it_-_google.mp3", "media_content_type": "music", "entity_id": ["media_player.nabaztag"]}, "service_call_id": "1965747120-71"}, "origin": "LOCAL", "time_fired": "2018-01-21T11:10:00.082612+00:00"}