TTS cached

by Eugen Gez

Version 4 (December 3, 2017)

Download (10 downloads)

A simple text-to-speech flow with a cache feature.

TTS engines sometimes need a little bit more time to process some texts. It also makes no sense to process the same text again and again. This flow builds a unique file path from the text and, if it does not exist yet, uses the "Speak to file" block to create a wav file containing the spoken text.

Start this flow from another one and it will speak the payload using default language and TTS engine.

To force a non-default language, prefix the text with a language code followed by hash character, just like:
"de_DE#Sprich deutsch!"
"en_GB#Speak english!"

Limitations: You cannot directly wait until it's finished. Use "Fiber stopped?" block as workaround.

Changelog:
2017-12-03
- Create cache directory if missing.
- Limit file name length.
2017-11-30
- Support optional language override.