A simple python script that allows you to use TTS in a Discord (or other app's) VC via Soundux (or any other soundboard program that allows setting custom shortcuts).
Warning
While this program was designed to be cross-platform, it has only been tested on Linux (specifically Arch w/ KDE Plasma 6.5.5).
Please report any issues you encounter, especially on those other OSes!
-
Any soundboard program that allows setting custom shortcuts.
I personally use/recommend Soundux.
*Only required when building from source.
Important
Ensure you have all of the necessary dependancies before following this guide!
-
Download the correct ZIP from the latest release (or any other release).
-
Extract the ZIP to a location you'll remember.
-
Delete the old ZIP file.
-
Clone this repository.
If you havegitinstalled:git clone https://github.com/DatBogie/Discord-TTS.git
Otherwise:
- On the repository page (likely the page you're on right now), click the green "<> Code" button, then the "Download ZIP" button.
- Extract the
Discord-TTS-main.zipfile to somewhere permanent (like your Documents folder).
-
Run either
setup.shorsetup.bat(only runsetup.batif you're on Windows). -
If you want to build from source (run from a binary rather than the raw python file), run
build.sh,build-mac.sh, orbuild.bat(build.batfor Windows,build-mac.shfor macOS).
Important
If you change the value of Soundboard Hotkey in config.yaml, make sure to also update output.wav's shortcut/hotkey in your soundboard app! (And vice-versa.)
- Run the executable file (
Discord-TTS/Discord-TTS.app/Discord-TTS.exe). You will have to re-run the app upon closing it or upon restarting your computer for it to work.
- Run either
run.shorrun.bat(only runrun.baton Windows). You will have to re-run the app upon closing it or upon restarting your computer for it to work.
-
Press the prompt hotkey (default:
CTRL+ALT+H), enter anything (don't leave it blank), then pressENTERor click "OK." -
Open your soundboard app and add a new sound. If your soundboard supports adding a single file as a sound, then add
output.wav(it'll be in the same folder this entire program is). Otherwise, add this entire program's folder. -
Add a custom shortcut/hotkey. By default, you should set it to
LEFT_CONTROL+LEFT_ALT+RIGHT_ALT+RIGHT_CONTROL(press both control keys and both alt keys at the same time).
If you'd like to set this to something else, that's fine—just make sure to updateSoundboard Hotkey's value inconfig.yaml, too! (See the instructions below.)
-
Run the program.
-
Right-click the tray icon and select "Open Voice List." Find the voice you'd like, noting its language (in parenthesis), name, and mode (high/medium/low).
-
Right-click the tray icon and select "Download Voice..." Type in the voice you'd like to download, in the format
<language>-<name>-<mode>, and click "OK." -
Your new voice is automatically applied!
-
Either press the "Change Voice Hotkey" (default:
CTRL+ALT+V) or right-click the tray icon and select "Change Voice..." -
Choose the voice from the dropdown menu and click "OK."
Changing your voice via either method will automatically update the config.yaml file.
Note that this will also remove all comments from said file. You can always view the default config file on GitHub for refrence!
-
Run the program, right click the tray icon, and click "Open Config." Alternatively, manually open
config.yamlin a text editor. -
Follow the instructions provided by the comments in the file.
This program includes the following technologies (bundled with pre-compiled binaries):
| Name | License | PyPI | Repository | Function |
|---|---|---|---|---|
| Piper-TTS | GPLv3 | pypi.org | github.com | TTS Generation |
| PySide6 | LGPLv3/GPLv3 | pypi.org | code.qt.io | GUI/Tray Icon |
| pynput | LGPLv3 | pypi.org | github.com | Keyboard Handler |
| PyYAML | MIT | pypi.org | github.com | YAML Parser |
