Written by DougDoug, with help from Banana! You are welcome to adapt/use this code for whatever you'd like. Credit is appreciated but not necessary.
If you would like a crappy video explanation of this project, I made a video covering the basics here: https://www.youtube.com/watch?v=vYE1rkIMj9w
-
This was written in Python 3.9.2. Install page here: https://www.python.org/downloads/release/python-392/
-
Run "pip install -r requirements.txt" to install all modules.
-
This uses the twitchio module to connect to your Twitch channel. First you must generate a Access Token for your account. You can do this at: https://twitchtokengenerator.com/ Then set the Acccess Token as a windows environment variable named TWITCH_ACCESS_TOKEN.
-
This uses Microsoft Azure's TTS service for the text-to-speech voices. First you must make an account and sign up for Microsoft Azure's services. Then use their site to generate an access key and region for the text-to-speech service. Then, set these as windows environment variables named AZURE_TTS_KEY and AZURE_TTS_REGION.
-
Open config.ini and edit the values inside to suit your use case,
-
CHANNEL_NAME is the Twitch Channel the program will read messages from
-
USER_NAME is the user the program will read out messages from
-
TTS_VOICE is the voice the TTS will use (en-US-DavisNeural, en-US-TonyNeural, en-US-JasonNeural, en-US-GuyNeural, en-US-JaneNeural, en-US-NancyNeural, en-US-JennyNeural, en-US-AriaNeural)
-
TTS_DEFAULT_EMOTION is the emotion the TTS will use when an emotion isn't provided by the chat member (angry, cheerful, excited, hopeful, sad, shouting, terrified, unfriendly, whispering, random)
-
-
Run chat_god_app.py
-
TTS begins disabled, the designated user can enable TTS by typing "!enable" in chat, when TTS is enabled all messages sent by the user designated in config.ini will be read out by Azure TTS, TTS can be disabled by the designated user by typing "!disable" in chat
- If a user starts their message with (angry), (cheerful), (excited), (hopeful), (sad), (shouting), (shout), (terrified), (unfriendly), (whispering), (whisper), or (random), it will automatically use that voice style.