This integration was made to help with TTS pronounce problems.
It lets you manipulate the text that your LLM assist returns, before it’s handed to the TTS service.
For example some TTS services have problem with units and decimal numbers in languages different to english.
Other TTS languages might have problems with specific names but support tags with phonetic transcriptions.
It also helps to reduce context size, as you don’t have to add rules to your prompt about how the response should be formatted.
Another benefit to not handle this in the prompt: The text returned is not optimized for speech and therefore often better for reading.
That helps in times when you chat to the assistant without speech.
It identifies itself as a TTS integration, so you can choose it as TTS service in the options dialog of your voice assistant.
In the options of the tts-proxy you can select a target TTS service where the manipulated text should be sent to.
It also uses streaming when the selected target TTS service supports it.
Features:
(Regex) Replacements
add literals or regex that should be replaced.
Some examples what’s possible:
°F → degrees
~ → about
(?<=\d)\smm\b → millimeter* (replaces mm only when a number or a number followed by whitespace is detected)
Number to string conversion
Detects numbers (including decimals) and convert them to a string optimized for speech.
Supports multiple languages as output format.
13.23 → thirteen point two three
Markdown Cleanup
You can activate different rules like removing bold/italic, header markings, URLs in links, quote/code markers, table formatting and more.
Emoji handling
You can decide to read the emojis like Siri does on Apple:
→ smiling face
or to simply remove them.
Dates
This is an advanced feature for German and English, with a fallback to simple convertion to numeric string conversion for other languages.
As I don’t speak any other languages, I couldn’t create the rules for more.
03/01/2022 → January third twenty twenty-two
05/23 → May twenty-third
For German:
31.10.1994 → einunddreißigster Oktober neunzehnhundertvierundneunzig
As German has more complicated grammar rules here, it also supports cases like
am/zum einunddreißigsten …
der einunddreißigste …
and so on.
