A TTS client for Twitch chat, integrated with GCP Text-to-speech (500 voices from 40+ languages).
Forked from takoz53's work. If you want to donate, send it to him.
You'll (maybe?) need to add System.Speech available on your System as Reference
You'll also need TwitchLib and Google.Cloud.TextToSpeech.V1 available on NuGet and you're good to go.
- Download the latest release and extract
- Run once to generate a Config folder
- Go into Config and open up creds.txt
- Set up your Bot-Account ID and enter your ID below "ID:"(Just create a Twitch Account, all lowercase!)
- Create an OAuth Key and enter your Key below "Oauth:"
- Set the channel, where it should connect to (all lowercase!)
- Open up the .exe and check what voices your PC Supports (It'll be shown inside the Console)
- Copy a voice its name (Care lower & uppercase) and put it in your Config it's options.txt its "voice"
- Set Max-Letters Length, which should be Displayed (After for example 40 Letters, the bot will say "to be continued")
- To read out everything until the end, leave the Setting at 0.
- Run the program, type something in your Chat and it should be working.
In order for the bot to be able to access the google API, a valid service account key with access to the text-to-speech API must be available in the gcp.json file in the config folder.
- Register for a free account at https://cloud.google.com/free (1 million wavenet characters per month are free, and 4 million free standard characters) Try out the TTS here: https://cloud.google.com/text-to-speech
I'd recommend setting up a budget of $0 just in case.
- In the menu on the left: APIs & Services -> Select login data
- Create a service account key with the button 'Create login data'.
- Enter service account name, select role project-> owner, key type: JSON
- Save the file as gcp.json
- In the menu on the left: APIs & Services -> Select Dashboard
- Activate the Cloud Text-to-Speech API with the button '+ APIS and services'
- Keep the program running while streaming and everyone will be able to hear the chat.
- Use badwords.txt to create your own wordfilter, tip: There are many out in the internet, so maybe you want to download some!
- Use blocklist.txt to block users (or bots) from TTS
- Example: Nightbot answers to uptime? Block him or time will be read out always
- Someone is being a bitch and abusing the Bot? Block him. This can be done while the Bot is running.
- Use usernames.json to give usernames other nicknames
- Example: Instead of takoz53, say "taco"
- This can be done while the Bot is running.
- The app should fall back on local Microsoft TTS if connectivity to GCP fails for whatever reason.
Could be a number of things. If chat is not appearing in the console, it could be an issue with creds.txt. If gcp voices aren't working, it could be an issue with gcp.json, or maybe your account is out of requests (haven't tested this).
Then I'd recommend you checking if your Twitch ID is lowercase, your channel is lowercase and the oauth key is right.
- Maximum allowed characters
- Sentence, if maximum allowed characters are exceeded
- Message connector
- Example: "takoz5334 said hello" can be changed to "takoz5334 speaks hello" or into any other language etc.
- Swearword replacing word, default is "beep" when something bad is written.
- The TTS Voice -
- Set GCP to True or False to enable/disable GCP voices
- Default Voice Options (For options.txt 'Default' or usernames.json 'voice' attribute per user)
- "Microsoft" - Uses local Microsoft TTS
- "Random" - Uses Random GCP Voice for all messages for all users not defined by usernames.json
- "Random-per-user" - Selects and stores a Random GCP Voice per user while the app is open
- Anything from voicelist.txt
Just write their name down in the blocklist, press enter and write another name in. Simple? Yes.
Just like in blocklist, go to usernames and assign each user a name, e.g. takoz53=taco xxswordmasterxx=swordmaster. Just note down, that the names have to be written in lowercase.
Yeah, definitely. You can by typing !block username and !unblock username. It'll do the checks whether the user is blocked and input is correct, so don't worry about typing something wrong.