Skip to content

RafiBG/AITalkingDiscordBot

Repository files navigation

AITalkingDiscordBot (Python Voice Client)

Python

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.


🧠 Architecture: How it Works

This bot serves as the ears and mouth for primary C# bot AIChatDiscordBotWeb (the "brain").

  1. Speech-to-Text (STT): The bot listens in the voice channel, records user speech, and converts it to text.
  2. AI Processing: The text is sent to the AIChatDiscordBotWeb (C#) for AI response generation.
  3. Text-to-Speech (TTS): The C# bot's response is sent back here. This Python client uses Piper TTS to generate the voice audio.
  4. 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.


🛠️ Prerequisites

Before running the bot, you must install and configure the following external tools:

1. FFmpeg (Audio Processing)

FFmpeg is essential for handling audio streams and must be installed and accessible in your system PATH.

2. Piper TTS (Voice Generation)

Piper is a fast, local, and high-quality Text-to-Speech engine.


⚙️ Installation & Setup

1. Discord Developer Portal

  1. Go to the Discord Developer Portal.
  2. Create a new application and go to the Bot tab.
  3. Privileged Gateway Intents: Scroll down and enable the intents shown below: privilage
  4. Installation: Ensure the bot has the following permissions enabled:
  5. Copy your Bot Token. You will need it.

1. Install Python Dependencies

pip install -r requirements.txt

2. Configure main.py

# 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]

3. Configure tts_processor.py

# Replace with the exact name of your downloaded Piper voice model (.onnx file)
PIPER_MODEL_NAME = "jarvis-high.onnx"

4. Run the bot

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"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages