This is the dedicated voice client for the AIChatDiscordBotWeb (C# repository). It handles all real-time audio processing, allowing users to talk directly to the AI in a Discord voice channel.
This bot serves as the ears and mouth for primary C# bot AIChatDiscordBotWeb (the "brain").
- Speech-to-Text (STT): The bot listens in the voice channel, records user speech, and converts it to text.
- AI Processing: The text is sent to the AIChatDiscordBotWeb (C#) for AI response generation.
- Text-to-Speech (TTS): The C# bot's response is sent back here. This Python client uses Piper TTS to generate the voice audio.
- Output: The generated audio is outputted back into the Discord voice channel.
IMPORTANT: This bot is a client only and requires the AIChatDiscordBotWeb to be running simultaneously.
Before running the bot, you must install and configure the following external tools:
FFmpeg is essential for handling audio streams and must be installed and accessible in your system PATH.
Piper is a fast, local, and high-quality Text-to-Speech engine.
- Install
Piper.exeand download your desired voice model (.onnxfile). - Video Guide: How to Install Piper TTS
- Go to the Discord Developer Portal.
- Create a new application and go to the Bot tab.
- Privileged Gateway Intents: Scroll down and enable the intents shown below:

- Installation: Ensure the bot has the following permissions enabled:

- Copy your Bot Token. You will need it.
pip install -r requirements.txt
# Replace with your specific Discord Bot Token for this application
TOKEN = "second-discord-bot-token"
# Replace with the Discord Server (Guild) ID where the bot will operate
GUILD_ID = [server-id]
# Replace with the exact name of your downloaded Piper voice model (.onnx file)
PIPER_MODEL_NAME = "jarvis-high.onnx"
main.py or in console "python main.py"
# Replace with the full, absolute path to the Piper.exe executable
PIPER_EXECUTABLE_PATH = "C:/Downloads/PiperTTS/piper.exe"