Streamer.bot TTS with custom AI voices
Streamer.bot can do almost anything when a viewer redeems a reward, and text to speech is one of the favourite tricks. Its own TTS goes through Speaker.bot and the voices installed on your system or in cloud services. If you want a redeem to speak as an announcer, a villain or a cartoon character, you can plug in your own voice instead.
This guide connects Streamer.bot to the free SuperClonica engine with a small tested Python script: the viewer types a message, the engine voices it offline on your PC and Streamer.bot plays the file on stream.
What you need
Streamer.bot on Windows, Python 3 and the free engine, installed with python -m pip install superclonica-cpu. Then a voice: the ten stock voices M1 to M5 and F1 to F5 come with the engine and may be used on monetized streams, and any catalog voice can be bought once and downloaded as a small JSON file. Make a folder such as C:\stream for the script, the voice and the audio.
The script
Save this as C:\stream\sb_tts.py. It reads the text from an environment variable, cuts it to 300 characters, skips empty messages and writes the audio file:
import os, shutil, subprocess, sys
text = os.environ.get('SC_TEXT', '').strip()[:300]
if not text:
sys.exit(0)
cli = shutil.which('superclonica') or os.path.join(os.path.dirname(sys.executable), 'Scripts', 'superclonica')
subprocess.run([cli, '--text', text, '--voice', os.environ.get('SC_VOICE', 'F1'),
'--lang', os.environ.get('SC_LANG', 'en'), '--output', os.environ.get('SC_OUT', 'tts.wav')], check=True)The text comes through an environment variable rather than the command line, so a viewer message with quotes or other symbols cannot break the command.
The action in Streamer.bot
Create a channel point reward with "Require viewer to enter text". In Streamer.bot add an action with the trigger Twitch, Channel Reward, Reward Redemption for that reward. Add the sub-action Core, System, Run a Program: Command python, Arguments C:\stream\sb_tts.py, Working Directory C:\stream, Wait for Exit 30, and in Environment Variables SC_TEXT = %rawInput%, SC_VOICE = C:\stream\voice.json, SC_LANG = en, SC_OUT = C:\stream\tts.wav. Then add Core, Sounds, Play Sound with the file C:\stream\tts.wav and leave "Finish playing before continuing" on, so the next redeem waits its turn.
How fast it is
On our test PC a five-second line took about eleven seconds from start to finished file, most of it loading the model, which the script does on every run. That is fine for redeems and alerts, which viewers expect to take a moment. For a voice that answers within a second or two, keep the engine loaded in a small local server, or call the SuperClonica speech API, whose free key gives 3 minutes of audio a day.
Keep it fun and safe
Give the reward a price and a cooldown in Twitch so chat cannot flood the stream, and keep the 300-character cut. Viewers can type anything, so moderate the reward like chat. Stock voices are fine for monetized streams; fan-made character voices are for parody and fan content, and no voice may be used to make it sound as if a real person said something.