Skip to content

DatBogie/Discord-TTS

Repository files navigation

Discord-TTS logo: The Discord logo wearing the Piper-TTS jester hat.

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!

Requirements

  1. Python 3*

  2. Any soundboard program that allows setting custom shortcuts.
    I personally use/recommend Soundux.

*Only required when building from source.

Installation/Setup

Important

Ensure you have all of the necessary dependancies before following this guide!

Pre-compiled Binaries

  1. Download the correct ZIP from the latest release (or any other release).

  2. Extract the ZIP to a location you'll remember.

  3. Delete the old ZIP file.

Building/Using from Source

  1. Clone this repository.
    If you have git installed:

    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.zip file to somewhere permanent (like your Documents folder).
  2. Run either setup.sh or setup.bat (only run setup.bat if you're on Windows).

  3. If you want to build from source (run from a binary rather than the raw python file), run build.sh, build-mac.sh, or build.bat (build.bat for Windows, build-mac.sh for macOS).

Usage

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.)

Running the Binary

  1. 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.

Running the Repository (No Binaries!)

  1. Run either run.sh or run.bat (only run run.bat on Windows). You will have to re-run the app upon closing it or upon restarting your computer for it to work.

General Instructions

  1. Press the prompt hotkey (default: CTRL+ALT+H), enter anything (don't leave it blank), then press ENTER or click "OK."

  2. 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.

  3. 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 update Soundboard Hotkey's value in config.yaml, too! (See the instructions below.)

Changing the TTS Voice

  1. Run the program.

  2. 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).

  3. 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."

  4. Your new voice is automatically applied!

Conviniently Switching Between Already Downloaded Voices

  1. Either press the "Change Voice Hotkey" (default: CTRL+ALT+V) or right-click the tray icon and select "Change Voice..."

  2. 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!

Otherwise Configuring This Program

  1. Run the program, right click the tray icon, and click "Open Config." Alternatively, manually open config.yaml in a text editor.

  2. Follow the instructions provided by the comments in the file.

Technologies

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

About

A very simple python script to allow playing TTS on a Discord (or another call app) VC via Soundux (or another soundboard app).

Resources

License

Stars

Watchers

Forks

Contributors