mirror of
https://github.com/System-End/tts.git
synced 2026-04-19 19:45:11 +00:00
91 lines
1.9 KiB
Text
91 lines
1.9 KiB
Text
Discord TTS Bot
|
|
===============
|
|
|
|
Simple TTS bot with multiple languages and crisp audio quality.
|
|
|
|
Setup
|
|
-----
|
|
|
|
1. Install FFmpeg
|
|
- Windows: Download from ffmpeg.org and add to PATH
|
|
- Mac: brew install ffmpeg
|
|
- Linux: sudo apt install ffmpeg
|
|
|
|
2. Install dependencies
|
|
pip install -r requirements.txt
|
|
|
|
3. Create .env file
|
|
cp .env.example .env
|
|
|
|
4. Add your Discord bot token to .env
|
|
DISCORD_TOKEN=your_token_here
|
|
|
|
5. Run the bot
|
|
python bot.py
|
|
|
|
|
|
Getting Bot Token
|
|
-----------------
|
|
|
|
1. Go to https://discord.com/developers/applications
|
|
2. Create New Application
|
|
3. Go to Bot section
|
|
4. Add Bot
|
|
5. Copy token
|
|
6. Paste in .env file
|
|
|
|
|
|
Invite Bot
|
|
----------
|
|
|
|
Use this URL (replace YOUR_CLIENT_ID):
|
|
https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=36719616&scope=bot%20applications.commands
|
|
|
|
Permissions needed: Connect, Speak, Use Slash Commands
|
|
|
|
|
|
Commands
|
|
--------
|
|
|
|
/tts <text> - Speak text (auto-joins voice channel)
|
|
/voice <lang> <voice> - Change voice
|
|
/stop - Disconnect from voice
|
|
|
|
|
|
Supported Languages
|
|
-------------------
|
|
|
|
English, Spanish, French, German, Japanese, Korean, Chinese, Italian,
|
|
Portuguese, Russian, Dutch, Polish, Turkish, Arabic, Hindi, Swedish,
|
|
Norwegian, Danish, Finnish, Greek, Czech, Hungarian, Thai, Vietnamese,
|
|
Indonesian, Ukrainian, Romanian, Bulgarian, Slovak, Croatian
|
|
|
|
Over 100 voices total.
|
|
|
|
|
|
Audio Quality
|
|
-------------
|
|
|
|
- 48kHz sample rate
|
|
- 128kbps bitrate (configurable in config.json)
|
|
- Audio normalization enabled
|
|
- Dynamic compression for clarity
|
|
|
|
To increase quality, edit config.json and change bitrate to 192 or 256.
|
|
|
|
|
|
Troubleshooting
|
|
---------------
|
|
|
|
Bot won't start:
|
|
- Check DISCORD_TOKEN is set in .env
|
|
- Make sure FFmpeg is installed
|
|
|
|
No audio:
|
|
- Install FFmpeg
|
|
- Check bot has Connect and Speak permissions
|
|
- Join a voice channel first
|
|
|
|
Commands don't show:
|
|
- Wait 1-2 minutes for Discord to sync
|
|
- Re-invite the bot
|