How It Works
All of the demo programs have a line that says:
tts.say(text)
for example:
tts.say("Hello, I am creating voice from a sentence of text.")
The text might be fixed, such as above. Or it might be the time in hours and minutes:
hour = 5minute = 30
period = "a m"print(f"The time is {hours} {minutes} {period}")
Where hour and minute could be read from a real time clock or via WiFi. This could be done for circuit measurements, temperature, or many other values read by sensors or other monitoring devices. Or you could make a circuit that measures the temperature and if it gets above 100 degrees, say "Danger Will Robinson".
Tips
Moonshine Klatt has a more literal speech methodology. It enumerates how the letters are put together, so "Circuit Python" sounds a bit garbled. PicoTTS does better. But notice the space in "Circuit Python" when we would write CircuitPython. That helps the models sound out the word better. This is also why, above, the text for the clock says "a m" instead of am, which might be processed as "am".
If you want to help the models pronounce things to a better degree, you can spell words more phonetically. You don't have to, but it might help if you wish. Take CircuitPython. It could be spelled "Sir cut pie thon" which helps break up the syllables. You can try various syllabic spellings to get better sounds. For the temperature example above, perhaps have it say "Dain jer wil robin son".
If you want individual numbers, put spaces between then. For example, to count, type:
"1 2 3 4 5"
not
"12345"
which could be read as twelve thousand three hundred forty five.
Advanced Use
There are function calls in each speech library. See the documentation for:
Icon from https://www.flaticon.com/free-icon/text-to-speech_10775666, free to use with attribution.
Page last edited October 06, 2026