TTS Alerts And Chat is a Streamlabs Chatbot script that provides text-to-speech capabilities for Streamlabs alerts, chat messages, and a customizable command.
The text-to-speech uses your computer's narrator voice and has some customization for voice, volume, and speech rate.
Feel free to reach out to me in the Streamlabs Chatbot discord (@Kruiser8) or on Twitter (@Kruiser8) with any questions or feedback.
Thanks to Ocgineer for his Streamlabs Event Receiver that allows events to be caught in a Streamlabs Chatbot script.
For chatbot script installation help, please view this guide: https://github.com/StreamlabsSupport/Streamlabs-Chatbot/wiki/Prepare-&-Import-Scripts
For setting up the text-to-speech overlay: https://github.com/StreamlabsSupport/Streamlabs-Chatbot/wiki/Script-overlays
Before the alert text-to-speech will work, you'll need to add a Streamlabs Socket API token.
- In Streamlabs Chatbot, open the Scripts tab
- Click the TTS Alerts And Chat script in order to open the settings sidebar
- At the bottom, select the Streamlabs Token dropdown
- Click the Get Socket Token button or go to https://streamlabs.com/dashboard#/settings/api-settings in a browser.
- In the browser, click the API Tokens tab
- Copy the Your Socket API Token
- Paste this value into the Streamlabs Socket Token setting in the chatbot
- Click the Save Settings button at the bottom of the script settings
All settings have extra information if you hover over the field in the chatbot. Below is a summarized list of settings.
All TTS Voice settings are in this section.
Set the narrator voice to use. This is a list of the narrator voices on your computer.
Set the volume of the narrator.
Set the pace of how fast the narrator should speak.
Set the maximum number of characters in a TTS message. This only applies to text-to-speech triggered by the command or chat message. This does not apply to alert messages.
Use 0 for no limit on characters.
Message to send to viewers when a TTS message is too long.
In this section, you can customize a command that uses text-to-speech.
Set the command to use for text-to-speech.
Set the viewer rank/role required to use the TTS command.
Set the user, rank, or tier for permission. Only used with certain permission levels: User_Specific, Min_Rank, Min_Points, Min_Hours.
The number of points required to use the TTS command.
Customize the message read by the narrator. The following variables will get replaced.
- {user} will be replaced with the viewer's username
- {message} will be replaced with the chat message
In this section, you can customize the usage for the TTS Command that uses text-to-speech.
Determine how viewer's can use the TTS command. Options allow support for messages through discord and whispers.
Enable this to send a message to a viewer when they attempt to trigger the command from an invalid location. For example, this applies when the Usage is Stream Chat and a viewer attempts to trigger the command via Discord.
This is the message to send to a viewer who triggers the command from an invalid location.
In this section, you can customize a cooldown for the TTS Command that uses text-to-speech.
Enable this to send a message when the command is on cooldown.
Enables the Caster to ignore the cooldown.
Set the number of seconds before the TTS command can be used again.
The message that the bot will display when the command is on cooldown.
- {user} will be replaced with the viewer's username
- {cooldown} will be replaced with the time remaining
Set the number of seconds before a user can use the TTS command again.
The message that the bot will display when the command is on user cooldown
- {user} will be replaced with the viewer's username
- {cooldown} will be replaced with the time remaining
In this section, you can toggle text-to-speech for ALL chat messages
Enable Text-To-Speech for all messages
Exclude reading messages that start with an exclamation point (!).
Customize the message read by the narrator. The following variables will get replaced.
- {user} will be replaced with the viewer's username
- {message} will be replaced with the chat message
In this section, you can customize the usage for triggering text-to-speech via a message.
Determine how viewer's can trigger text-to-speech. Options allow support for messages through discord and whispers.
Enable this to send a message to a viewer when they attempt to trigger the command from an invalid location. For example, this applies when the Usage is Stream Chat and a viewer attempts to trigger the command via Discord.
This is the message to send to a viewer who triggers the command from an invalid location.
Text-to-speech messages can be displayed on a customizable overlay.
Enable this to not display alert text-to-speech messages on the overlay.
Use this to format the message displayed on the overlay when triggered via command, chat messages, or messages included with alerts.
Note: This format will not apply to alert responses but WILL apply for messages included with alerts.
Customize how the font looks on the overlay. Font family must be an available font on your computer.
Set the background color of the overlay.
Set the border color of the overlay.
Control the positioning of the overlay within the browser source by aligning the overlay to the left, center, or right and top, center, or bottom.
Choose which animate.css animations to use when displaying the overlay.
There are alert types across Mixer, Streamlabs, Twitch, and Youtube that are customizable. To save space, below is a summary of setting types.
Enable TTS for the given alert.
Delay in seconds to read the alert after receiving it. If two alerts are received simultaneously, the second's delay may be lost.
This setting is an attempt to delay TTS until after alert sfx is finished. Unfortunately, the script receives alerts instantly as opposed to through the queue that Streamlabs provides.
The format of the alert to be read by text-to-speech. There are a number of variables available per alert type. Hover over the message in the settings for a detailed list for that alert.
- {name} will be replaced with the username
- {amount} will be replaced with a number for that alert (viewers, raiders, bits, etc.)
- {isPlural} is sometimes used to provide an 's' when amount > 1
- {tier} is the Twitch subscription tier
- {months} is the number of months of a subscription
- {gifter} is the gifter of a Twitch sub
- {recipients} is the comma-delimited list of viewers that are gifted subs when more than 1 sub is gifted to the channel
Use these to customize the command used to ban users. The command is used as follows:
!banuser kruiser8
- to ban/unban the user named kruiser8
!banuser kruiser8 300
- to ban/unban the user named kruiser8 for 300 seconds
Edit this file to control and view which users are banned from TTS.
The message sent in chat when a user is banned from using TTS.
- {user} will be replaced with the user who used the !banuser command
- {banned} will be replaced with a user that was banned
The message sent in chat when a user is unbanned from using TTS.
- {user} will be replaced with the user who used the !banuser command
- {banned} will be replaced with a user that was unbanned
Use these to customize the command used to ban words and phrases. The command is used as follows:
!banword toy
- to ban/unban the word toy
Choose whether to skip messages with banned words or replace the words.
Enable this to match words in the banned.txt file exactly. If disabled (unchecked), partial words will be matched. As an example, if fu is a banned word and the message contains fudge, the message will get blocked if this setting is unchecked. This helps avoid trolls that combine words together.
This field is used to replace banned words when found in messages if Replace Banned Words was selected as the Banned Words Setting.
Edit this file to control what words or phrases are banned from TTS. Each banned word or phrase should be on its own line.
The message sent in chat when a word is banned from use in TTS.
- {user} will be replaced with the user who used the !banword command
- {word} will be replaced with a word that was banned
The message sent in chat when a word is unbanned from use in TTS.
- {user} will be replaced with the user who used the !banword command
- {word} will be replaced with the word that was unbanned
Your Socket API Token from https://streamlabs.com/dashboard#/settings/api-settings. See the Usage section for details.
This script was made by Kruiser8 (https://twitch.tv/kruiser8) and is licensed under the Creative Commmons Attribution 4.0 International License (CC BY 4.0)
For License information, visit https://creativecommons.org/licenses/by/4.0/