Tts.speak output to file instead of media player for later use

I’d like tts.speak to have a file_path parameter that accepts a path to where a media file should be stored (i.e. /local/tts/example_name.wav) containing the speech. If the file_path parameter is used, a media_player should not be required, but can be optional.

This feature enables TTS to be pre-generated and used later, or used with systems that can play media files, but are not media players (Asterisk for VoIP is a great example and also happens to be my use case).

You might want to look into Rhasspy.
It is the code used for the coming Voice Assistants, but it is already a standalone product with good integration for HA and it is modular built, so you can choose the modules you want.
It can for sure do TTS to a wave or MP3 file and you will have multiple modules for the TTS feature.

https://rhasspy.readthedocs.io/en/latest/

Thanks, Wally. I see it can POST a .wav file to an endpoint which is cool. I’m hoping to accomplish my task with a lighter weight process (i.e. built-in, no additional add-on) so I may just sit tight until functionality to capture the file is added.

Well, it is most likely coming, since Rhasspy is sort of the prototype for HA’s Voice Assistant and knowing how Mike Hansen looks at building code up, then it will be quite modular and flexible.

1 Like

That’s my hope! I am really loving Assist and am super excited to see what’s next.