docs: move cog documentation into the wiki and stub the README
The root README carried the full ten cog manual while the wiki held the authoritative pages. Point the repository at the wiki, keep only install and catalog basics in the README, and remove the per cog documents that are now folded into wiki source under wiki/.
This commit is contained in:
@@ -1,126 +0,0 @@
|
||||
# TTS Toy
|
||||
|
||||
A RedBot cog for text-to-speech in voice chat with multiple TTS engines, emoji sound effects, and voice cloning.
|
||||
|
||||
## Modes
|
||||
|
||||
| Mode | Description | Requires |
|
||||
|------|-------------|----------|
|
||||
| `minimax` | MiniMax cloud API, natural voices | API key |
|
||||
| `chatterbox` | Local Chatterbox server, AI voice cloning | Chatterbox server |
|
||||
| `dectalk` | Classic 1980s robotic voice | DECTalk server |
|
||||
| `morshu` | Morshu from CD-i Zelda | g2p_en, numpy, pydub |
|
||||
| `vox` | Black Mesa VOX announcer | Built-in |
|
||||
| `piper` | Local Piper neural TTS, fast voices | Piper HTTP server |
|
||||
|
||||
Switch modes: `[p]ttstoy mode <mode>`
|
||||
|
||||
## Quick Start
|
||||
|
||||
```
|
||||
[p]ttstoy mode chatterbox
|
||||
[p]chatterbox addvoice MyVoice (attach .wav/.mp3 or paste a URL)
|
||||
[p]tts Hello world [laugh] this is cool
|
||||
```
|
||||
|
||||
## Commands
|
||||
|
||||
Use `[p]ttstoy` to see all available commands for the current mode.
|
||||
|
||||
### Chatterbox Voice Management
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `[p]chatterbox addvoice <name>` | Upload a voice clip (attach file or paste URL) |
|
||||
| `[p]chatterbox removevoice <name>` | Remove a voice and delete from server |
|
||||
| `[p]chatterbox sharevoice <name> @User` | Share a voice with another user |
|
||||
| `[p]chatterbox myvoices` | List your voices |
|
||||
| `[p]chatterbox temp [0.0-1.5]` | Per-voice randomness (per voice per user) |
|
||||
| `[p]chatterbox exag [0.25-2.0]` | Per-voice expressiveness (per voice per user) |
|
||||
| `[p]chatterbox volume [-20-20]` | Per-voice dB loudness offset (per voice per user) |
|
||||
| `[p]chatterbox guide` | Full feature guide |
|
||||
| `[p]chatterbox model [turbo\|original]` | Switch Chatterbox model (owner) |
|
||||
| `[p]chatterbox url [url]` | Set Chatterbox server URL (owner) |
|
||||
|
||||
Append `reset` to temp, exag, or volume to clear the setting.
|
||||
|
||||
### General
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `[p]tts <text>` | Speak in voice chat |
|
||||
| `[p]ttstoy myvoice [name]` | Set or view your personal voice |
|
||||
| `[p]ttstoy voice [name]` | Set global default voice (owner) |
|
||||
| `[p]ttstoy mode [mode]` | Show or set TTS mode (owner) |
|
||||
| `[p]ttstoy sfxvolume [0-100]` | Set SFX volume (owner) |
|
||||
| `[p]sfx` | List available sound effects |
|
||||
| `[p]ttstoy info` | DM setup instructions |
|
||||
|
||||
### DECTalk
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `[p]ttstoy dectalkinstall` | Install built-in DECTalk server |
|
||||
| `[p]ttstoy dectalkstart` | Start server |
|
||||
| `[p]ttstoy dectalkstop` | Stop server |
|
||||
| `[p]ttstoy dectalkstatus` | Check server status |
|
||||
| `[p]ttstoy dectalkautotoggle` | Toggle auto-start |
|
||||
| `[p]ttstoy dectalkurl [url]` | Set DECTalk API URL |
|
||||
|
||||
DECTalk voices are controlled in-text: `[:np]` Paul, `[:nb]` Betty, `[:nh]` Harry, `[:nf]` Frank, `[:nd]` Dennis, `[:nk]` Kit, `[:nu]` Ursula, `[:nr]` Rita, `[:nw]` Wendy.
|
||||
|
||||
### VOX
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `[p]ttstoy voxpack [vox\|vox2]` | Switch VOX voice pack |
|
||||
| `[p]ttstoy voxwords` | List available words |
|
||||
|
||||
### Piper
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `[p]ttstoy piperurl [url]` | Show or set the Piper server URL (default http://127.0.0.1:5006) |
|
||||
| `[p]ttstoy pipervoice [model_id]` | Set the Piper voice model (e.g. en_US-ryan-medium); `reset` for server default |
|
||||
|
||||
Piper speaks via a Piper HTTP server's `/synthesize` endpoint. Any model id
|
||||
whose `.onnx` is in the server's data dir can be selected, even if it is not
|
||||
in the `/voices` listing.
|
||||
|
||||
### Accessibility
|
||||
|
||||
Accessibility mode auto-reads the side chat of the voice channel the bot is in
|
||||
(no command prefix needed), using a single engine (dectalk or piper) with emoji
|
||||
SFX disabled. The first message from a user since someone else last spoke is
|
||||
prefixed `Name said:` (this can be turned off with
|
||||
`[p]ttstoy accessibility names off`); links, images, and files are announced
|
||||
instead of read.
|
||||
|
||||
Each speaker is auto-assigned a distinct voice from the active engine's pool so
|
||||
they can be told apart. Users can pick their own voice. Voice assignments are
|
||||
in-memory only and are NOT saved between sessions.
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `[p]ttstoy accessibility start` | Enable accessibility mode (owner) |
|
||||
| `[p]ttstoy accessibility stop` | Disable accessibility mode (owner) |
|
||||
| `[p]ttstoy accessibility engine [dectalk\|piper]` | Choose the engine (owner); clears per-user voices |
|
||||
| `[p]ttstoy accessibility names [on\|off]` | Show or set whether `Name said:` is read before a message (owner) |
|
||||
| `[p]ttstoy accessibility voice [name]` | Pick your own voice for the current engine (`auto` to be auto-assigned) |
|
||||
|
||||
## Emoji SFX
|
||||
|
||||
Include emoji in your TTS text to trigger sound effects:
|
||||
|
||||
```
|
||||
[p]tts Hello 🎉 world 🔥
|
||||
```
|
||||
|
||||
Use `[p]sfx` to see all available triggers. Add `.mp3` files to `sfx/<folder>/` to customize.
|
||||
|
||||
## Requirements
|
||||
|
||||
- RedBot 3.5+
|
||||
- Audio cog loaded
|
||||
- ffmpeg
|
||||
- `requests`, `g2p_en`, `numpy`, `pydub` (pip)
|
||||
@@ -1,83 +0,0 @@
|
||||
# Installing Authentic DECTalk Server
|
||||
|
||||
This guide shows how to install and run the authentic DECTalk server with the Moonbase Alpha voice.
|
||||
|
||||
## Quick Install
|
||||
|
||||
```bash
|
||||
cd ~/devcogs/ttstoy/dectalk-server
|
||||
npm install
|
||||
```
|
||||
|
||||
This installs the `dectalk` npm package which includes the authentic DECTalk binaries.
|
||||
|
||||
## What You Get
|
||||
|
||||
The `dectalk` package provides:
|
||||
- Perfect Paul voice (the Moonbase Alpha voice)
|
||||
- Authentic DECTalk synthesis engine
|
||||
- Support for DECTalk phoneme commands
|
||||
- Same voice used by Stephen Hawking
|
||||
|
||||
## Start the Server
|
||||
|
||||
```bash
|
||||
PORT=33001 npm start
|
||||
```
|
||||
|
||||
Or use the start script:
|
||||
```bash
|
||||
./start.sh
|
||||
```
|
||||
|
||||
## Test It
|
||||
|
||||
```bash
|
||||
# Test health
|
||||
curl http://127.0.0.1:33001/health
|
||||
|
||||
# Generate audio
|
||||
curl "http://127.0.0.1:33001/say?text=aeiou" -o aeiou.mp3
|
||||
ffplay aeiou.mp3
|
||||
```
|
||||
|
||||
## Configure TTSTOY
|
||||
|
||||
In Discord:
|
||||
```
|
||||
[p]ttstoy mode dectalk
|
||||
[p]ttstoy dectalkurl http://127.0.0.1:33001
|
||||
[p]tts aeiou john madden
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "Cannot find module 'dectalk'"
|
||||
|
||||
Run `npm install` in the dectalk-server directory.
|
||||
|
||||
### Port already in use
|
||||
|
||||
Use a different port:
|
||||
```bash
|
||||
PORT=33002 npm start
|
||||
```
|
||||
|
||||
### Linux dependency issues
|
||||
|
||||
The dectalk package may need additional libraries:
|
||||
```bash
|
||||
sudo apt install libasound2
|
||||
```
|
||||
|
||||
## DECTalk Commands
|
||||
|
||||
You can use DECTalk phoneme commands in your text:
|
||||
|
||||
```
|
||||
[p]tts [:phoneme on] hehlow werld
|
||||
[p]tts [:rate 200] speaking very fast
|
||||
[p]tts [:dv ap 100] aeiou
|
||||
```
|
||||
|
||||
These commands control pitch, rate, and other voice parameters just like in Moonbase Alpha.
|
||||
@@ -1,186 +0,0 @@
|
||||
# Integration with RedBot TTSTOY
|
||||
|
||||
This guide shows how to integrate the DECTalk server with your RedBot TTSTOY cog.
|
||||
|
||||
## Quick Start
|
||||
|
||||
### 1. Install and Start DECTalk Server
|
||||
|
||||
```bash
|
||||
cd dectalk-server
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
The server will start on `http://127.0.0.1:3000`
|
||||
|
||||
### 2. Configure TTSTOY
|
||||
|
||||
In your Discord server, run these commands:
|
||||
|
||||
```
|
||||
[p]ttstoy mode dectalk
|
||||
[p]ttstoy dectalkurl http://127.0.0.1:3000
|
||||
```
|
||||
|
||||
### 3. Test It
|
||||
|
||||
```
|
||||
[p]tts Hello, I am DECTalk, a text to speech system.
|
||||
```
|
||||
|
||||
## API Compatibility
|
||||
|
||||
The DECTalk server implements the same API format as your local-tts server:
|
||||
|
||||
### Endpoints
|
||||
|
||||
| Endpoint | Method | Purpose | Compatible With |
|
||||
|----------|--------|---------|-----------------|
|
||||
| `/health` | GET | Health check | local-tts |
|
||||
| `/engine` | GET | Engine info | local-tts |
|
||||
| `/say?text=<text>` | GET | Simple TTS | DECTalk-specific |
|
||||
| `/v1/t2a_v2` | POST | MiniMax-compatible TTS | TTSTOY cog |
|
||||
|
||||
### Response Format
|
||||
|
||||
The `/v1/t2a_v2` endpoint returns the exact same format as MiniMax API:
|
||||
|
||||
```json
|
||||
{
|
||||
"base_resp": {
|
||||
"status_code": 0,
|
||||
"status_msg": "Success"
|
||||
},
|
||||
"data": {
|
||||
"audio": "<hex-encoded-mp3-data>",
|
||||
"audio_id": "<unique-identifier>"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This matches the format expected by `_save_minimax_tts()` in your TTSTOY cog.
|
||||
|
||||
## How It Works
|
||||
|
||||
1. **Text Input**: TTSTOY sends text via POST to `/v1/t2a_v2`
|
||||
2. **DECTalk Generation**: Server generates WAV audio using DECTalk
|
||||
3. **MP3 Conversion**: ffmpeg converts WAV to MP3 (mono, 32kHz, 128kbps)
|
||||
4. **Hex Encoding**: MP3 is converted to hex string (MiniMax format)
|
||||
5. **Response**: Server returns hex-encoded audio in MiniMax-compatible JSON
|
||||
|
||||
## Switching Between TTS Modes
|
||||
|
||||
You can easily switch between different TTS engines:
|
||||
|
||||
```bash
|
||||
# Use MiniMax cloud API
|
||||
[p]ttstoy mode minimax
|
||||
|
||||
# Use local AI TTS
|
||||
[p]ttstoy mode local
|
||||
[p]ttstoy localurl http://127.0.0.1:8000
|
||||
|
||||
# Use DECTalk
|
||||
[p]ttstoy mode dectalk
|
||||
[p]ttstoy dectalkurl http://127.0.0.1:3000
|
||||
```
|
||||
|
||||
## Features Supported
|
||||
|
||||
✅ Text-to-speech synthesis
|
||||
✅ Emoji SFX (handled by TTSTOY cog)
|
||||
✅ Audio concatenation (handled by TTSTOY cog)
|
||||
✅ Volume control (handled by TTSTOY cog)
|
||||
❌ Voice selection (DECTalk has one voice)
|
||||
❌ Speed control (not implemented yet)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Server won't start
|
||||
|
||||
Check if port 3000 is already in use:
|
||||
```bash
|
||||
lsof -i :3000
|
||||
```
|
||||
|
||||
Use a different port:
|
||||
```bash
|
||||
PORT=8080 npm start
|
||||
```
|
||||
|
||||
### "Cannot reach DECTalk API"
|
||||
|
||||
1. Check if server is running:
|
||||
```bash
|
||||
curl http://127.0.0.1:3000/health
|
||||
```
|
||||
|
||||
2. Check server logs for errors
|
||||
|
||||
3. Verify ffmpeg is installed:
|
||||
```bash
|
||||
ffmpeg -version
|
||||
```
|
||||
|
||||
### Audio quality issues
|
||||
|
||||
The server outputs MP3 at:
|
||||
- Sample rate: 32kHz
|
||||
- Bitrate: 128kbps
|
||||
- Channels: Mono
|
||||
|
||||
This matches TTSTOY's expectations. If you need different settings, modify the `convertToMP3()` function in `server.js`.
|
||||
|
||||
## Production Deployment
|
||||
|
||||
### Using systemd
|
||||
|
||||
1. Edit `dectalk-server.service` with your paths
|
||||
2. Copy to systemd:
|
||||
```bash
|
||||
sudo cp dectalk-server.service /etc/systemd/system/
|
||||
```
|
||||
|
||||
3. Enable and start:
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable dectalk-server
|
||||
sudo systemctl start dectalk-server
|
||||
sudo systemctl status dectalk-server
|
||||
```
|
||||
|
||||
### Using PM2
|
||||
|
||||
```bash
|
||||
npm install -g pm2
|
||||
pm2 start server.js --name dectalk-server
|
||||
pm2 save
|
||||
pm2 startup
|
||||
```
|
||||
|
||||
## Performance Notes
|
||||
|
||||
- Each TTS request generates a new MP3 file
|
||||
- Files are saved to `output/` directory
|
||||
- Consider adding cleanup for old files
|
||||
- DECTalk is fast and lightweight compared to AI TTS
|
||||
|
||||
## Comparison with local-tts
|
||||
|
||||
| Feature | local-tts | dectalk-server |
|
||||
|---------|-----------|----------------|
|
||||
| Voice Quality | Natural (AI) | Robotic (classic) |
|
||||
| Speed | Slower | Faster |
|
||||
| Resources | High (GPU recommended) | Low |
|
||||
| Voice Cloning | Yes | No |
|
||||
| API Key | No | No |
|
||||
| Setup Complexity | High | Low |
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Replace `say` command with actual DECTalk binary for authentic voice
|
||||
- Add voice parameter support (if using multi-voice DECTalk)
|
||||
- Implement speed control
|
||||
- Add audio file cleanup
|
||||
- Add rate limiting
|
||||
@@ -1,237 +0,0 @@
|
||||
# DECTalk TTS Server
|
||||
|
||||
A simple Node.js server that provides DECTalk text-to-speech with MiniMax-compatible API endpoints for RedBot TTSTOY cog.
|
||||
|
||||
## Features
|
||||
|
||||
- Authentic DECTalk voice (Perfect Paul - same as Moonbase Alpha)
|
||||
- MiniMax-compatible API endpoint (`/v1/t2a_v2`) for seamless integration with TTSTOY
|
||||
- Simple GET endpoint (`/say?text=<text>`) for testing
|
||||
- Automatic WAV to MP3 conversion using ffmpeg
|
||||
- Health check endpoint (`/health`)
|
||||
|
||||
## Requirements
|
||||
|
||||
- Node.js (v14 or higher)
|
||||
- npm
|
||||
- ffmpeg (for audio conversion)
|
||||
- Linux system (DECTalk package doesn't support macOS)
|
||||
|
||||
### Installing Dependencies
|
||||
|
||||
**Ubuntu/Debian:**
|
||||
```bash
|
||||
sudo apt install nodejs npm ffmpeg
|
||||
```
|
||||
|
||||
**Fedora:**
|
||||
```bash
|
||||
sudo dnf install nodejs npm ffmpeg
|
||||
```
|
||||
|
||||
**Arch Linux:**
|
||||
```bash
|
||||
sudo pacman -S nodejs npm ffmpeg
|
||||
```
|
||||
|
||||
**macOS:**
|
||||
```bash
|
||||
brew install node ffmpeg
|
||||
# macOS has built-in 'say' command, no need for espeak
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
cd dectalk-server
|
||||
npm install
|
||||
```
|
||||
|
||||
This will install:
|
||||
- `express` - Web server framework
|
||||
- `dectalk` - Authentic DECTalk voice synthesis (Moonbase Alpha)
|
||||
|
||||
The `dectalk` package includes the actual DECTalk binaries and will work on Linux systems.
|
||||
|
||||
## Usage
|
||||
|
||||
### Start the server
|
||||
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
The server will run on port 3000 by default.
|
||||
|
||||
### Custom port
|
||||
|
||||
```bash
|
||||
PORT=8080 npm start
|
||||
```
|
||||
|
||||
### Custom output directory
|
||||
|
||||
```bash
|
||||
OUTPUT_DIR=/path/to/output npm start
|
||||
```
|
||||
|
||||
## API Endpoints
|
||||
|
||||
### Health Check
|
||||
```bash
|
||||
GET /health
|
||||
```
|
||||
|
||||
Returns:
|
||||
```json
|
||||
{"status": "ok"}
|
||||
```
|
||||
|
||||
### Engine Info
|
||||
```bash
|
||||
GET /engine
|
||||
```
|
||||
|
||||
Returns:
|
||||
```json
|
||||
{
|
||||
"type": "dectalk",
|
||||
"version": "1.0.0",
|
||||
"description": "DECTalk Text-to-Speech Engine"
|
||||
}
|
||||
```
|
||||
|
||||
### Simple TTS (GET)
|
||||
```bash
|
||||
GET /say?text=Hello%20world
|
||||
```
|
||||
|
||||
Returns: MP3 audio file
|
||||
|
||||
### MiniMax-Compatible TTS (POST)
|
||||
```bash
|
||||
POST /v1/t2a_v2
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"text": "Hello world",
|
||||
"voice_setting": {
|
||||
"voice_id": "default",
|
||||
"speed": 1.0
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Returns:
|
||||
```json
|
||||
{
|
||||
"base_resp": {
|
||||
"status_code": 0,
|
||||
"status_msg": "Success"
|
||||
},
|
||||
"data": {
|
||||
"audio": "<hex-encoded-mp3>",
|
||||
"audio_id": "<unique-id>"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Integration with RedBot TTSTOY
|
||||
|
||||
1. Start the DECTalk server:
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
2. Configure TTSTOY to use DECTalk mode:
|
||||
```
|
||||
[p]ttstoy mode dectalk
|
||||
[p]ttstoy dectalkurl http://127.0.0.1:3000
|
||||
```
|
||||
|
||||
3. Test it:
|
||||
```
|
||||
[p]tts Hello, I am DECTalk
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- Uses authentic DECTalk (Perfect Paul voice from Moonbase Alpha)
|
||||
- The `dectalk` npm package includes the actual DECTalk binaries
|
||||
- Audio files are saved to the `output/` directory
|
||||
- MP3 format: mono, 32kHz, 128kbps (matches TTSTOY expectations)
|
||||
- Supports all 9 original DECTalk voices
|
||||
- Supports DECTalk phoneme commands (e.g., `[:phoneme on]`, `[:rate 200]`)
|
||||
|
||||
## DECTalk Commands
|
||||
|
||||
DECTalk supports special commands for controlling speech:
|
||||
|
||||
```
|
||||
[:phoneme on] - Enable phoneme mode
|
||||
[:rate 200] - Set speech rate (default 180)
|
||||
[:dv ap 100] - Set voice parameters
|
||||
```
|
||||
|
||||
Example:
|
||||
```bash
|
||||
curl "http://127.0.0.1:33001/say?text=%5B:rate%20150%5DHello%20world&voice=paul" -o test.mp3
|
||||
```
|
||||
|
||||
You can also use these in Discord:
|
||||
```
|
||||
[p]tts [:rate 200] speaking very fast
|
||||
[p]tts [:phoneme on] hehlow werld
|
||||
```
|
||||
|
||||
## DECTalk Voices
|
||||
|
||||
DECTalk includes 9 classic voices:
|
||||
|
||||
| Voice | Name | Description |
|
||||
|-------|------|-------------|
|
||||
| Paul | Perfect Paul | Default male voice (Moonbase Alpha, Stephen Hawking) |
|
||||
| Betty | Beautiful Betty | Female voice |
|
||||
| Harry | Huge Harry | Deep male voice |
|
||||
| Frank | Frail Frank | Elderly male voice |
|
||||
| Dennis | Doctor Dennis | Male voice |
|
||||
| Kit | Kit the Kid | Child voice |
|
||||
| Ursula | Uppity Ursula | Female voice |
|
||||
| Rita | Rough Rita | Female voice |
|
||||
| Wendy | Whispering Wendy | Soft female voice |
|
||||
|
||||
### Using Different Voices
|
||||
|
||||
**In Discord:**
|
||||
```
|
||||
[p]ttstoy voice Paul
|
||||
[p]tts Hello, I am Perfect Paul
|
||||
[p]ttstoy voice Betty
|
||||
[p]tts Hello, I am Beautiful Betty
|
||||
```
|
||||
|
||||
**Direct API:**
|
||||
```bash
|
||||
curl "http://127.0.0.1:33001/say?text=Hello&voice=paul" -o paul.mp3
|
||||
curl "http://127.0.0.1:33001/say?text=Hello&voice=betty" -o betty.mp3
|
||||
```
|
||||
|
||||
**List available voices:**
|
||||
```bash
|
||||
curl http://127.0.0.1:33001/voices
|
||||
```
|
||||
|
||||
## Customization
|
||||
|
||||
The server uses the default DECTalk voice (Perfect Paul). The `dectalk` package handles all the voice synthesis internally, so no additional configuration is needed for the authentic Moonbase Alpha sound.
|
||||
|
||||
## Development
|
||||
|
||||
Run with auto-reload:
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
@@ -1,158 +0,0 @@
|
||||
# Testing DECTalk Server with TTSTOY
|
||||
|
||||
Quick testing guide to verify everything works.
|
||||
|
||||
## Step 1: Start the DECTalk Server
|
||||
|
||||
```bash
|
||||
cd ~/Desktop/ttstoy/dectalk-server
|
||||
PORT=33001 npm start
|
||||
```
|
||||
|
||||
You should see:
|
||||
```
|
||||
DECTalk TTS Server running on http://localhost:33001
|
||||
Health check: http://localhost:33001/health
|
||||
Simple API: http://localhost:33001/say?text=Hello
|
||||
MiniMax-compatible API: POST http://localhost:33001/v1/t2a_v2
|
||||
```
|
||||
|
||||
## Step 2: Test the API Directly
|
||||
|
||||
Open a new terminal and test:
|
||||
|
||||
```bash
|
||||
# Test health check
|
||||
curl http://127.0.0.1:33001/health
|
||||
|
||||
# Test simple endpoint (saves to test.mp3)
|
||||
curl "http://127.0.0.1:33001/say?text=Hello%20world" -o test.mp3
|
||||
|
||||
# Play the audio
|
||||
ffplay test.mp3
|
||||
# or
|
||||
mpv test.mp3
|
||||
|
||||
# Test MiniMax-compatible endpoint
|
||||
curl -X POST http://127.0.0.1:33001/v1/t2a_v2 \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"text": "Testing DECTalk compatibility", "voice_setting": {"voice_id": "default"}}' \
|
||||
| jq '.base_resp'
|
||||
```
|
||||
|
||||
Expected output:
|
||||
```json
|
||||
{
|
||||
"status_code": 0,
|
||||
"status_msg": "Success"
|
||||
}
|
||||
```
|
||||
|
||||
## Step 3: Configure TTSTOY
|
||||
|
||||
In Discord:
|
||||
|
||||
```
|
||||
[p]ttstoy dectalkurl http://127.0.0.1:33001
|
||||
[p]ttstoy mode dectalk
|
||||
[p]ttstoy mode
|
||||
```
|
||||
|
||||
You should see:
|
||||
```
|
||||
Current TTS Mode: 🤖 DECTALK
|
||||
DECTalk API URL: http://127.0.0.1:33001
|
||||
```
|
||||
|
||||
## Step 4: Test TTS in Discord
|
||||
|
||||
```
|
||||
[p]tts Hello, I am DECTalk, a text to speech system.
|
||||
```
|
||||
|
||||
The bot should:
|
||||
1. Generate audio using DECTalk
|
||||
2. Upload the MP3 file to Discord
|
||||
3. Play it in voice chat
|
||||
|
||||
## Step 5: Test with Emoji SFX
|
||||
|
||||
```
|
||||
[p]tts Hello 🎉 this is a party 🔥
|
||||
```
|
||||
|
||||
The bot should mix DECTalk voice with sound effects.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Server won't start (port in use)
|
||||
|
||||
```bash
|
||||
# Find what's using port 33001
|
||||
lsof -i :33001
|
||||
|
||||
# Use a different port
|
||||
PORT=33002 npm start
|
||||
|
||||
# Update TTSTOY
|
||||
[p]ttstoy dectalkurl http://127.0.0.1:33002
|
||||
```
|
||||
|
||||
### "Cannot reach DECTalk API"
|
||||
|
||||
1. Check server is running:
|
||||
```bash
|
||||
curl http://127.0.0.1:33001/health
|
||||
```
|
||||
|
||||
2. Check server logs in the terminal where you started it
|
||||
|
||||
3. Verify URL in TTSTOY:
|
||||
```
|
||||
[p]ttstoy dectalkurl
|
||||
```
|
||||
|
||||
### Audio not playing
|
||||
|
||||
1. Make sure ffmpeg is installed:
|
||||
```bash
|
||||
ffmpeg -version
|
||||
```
|
||||
|
||||
2. Check bot logs for errors
|
||||
|
||||
3. Test the `/say` endpoint directly and play the audio
|
||||
|
||||
### "say: command not found" (Linux)
|
||||
|
||||
The current server uses macOS `say` command. On Linux, you need to:
|
||||
|
||||
1. Install actual DECTalk or use espeak:
|
||||
```bash
|
||||
# Option 1: espeak (simple)
|
||||
sudo apt install espeak
|
||||
|
||||
# Option 2: Install dectalk-tts
|
||||
npm install -g dectalk-tts
|
||||
```
|
||||
|
||||
2. Modify `server.js` to use the appropriate command
|
||||
|
||||
## Success Checklist
|
||||
|
||||
- [ ] DECTalk server starts without errors
|
||||
- [ ] `/health` endpoint returns `{"status": "ok"}`
|
||||
- [ ] `/say` endpoint generates audio file
|
||||
- [ ] TTSTOY mode switches to dectalk
|
||||
- [ ] `[p]tts` command works in Discord
|
||||
- [ ] Audio plays in voice chat
|
||||
- [ ] Emoji SFX work correctly
|
||||
|
||||
## Next Steps
|
||||
|
||||
Once everything works:
|
||||
|
||||
1. Set up auto-start with systemd or PM2
|
||||
2. Configure firewall if needed
|
||||
3. Consider using actual DECTalk binary for authentic voice
|
||||
4. Add cleanup for old audio files in output/
|
||||
@@ -1,69 +0,0 @@
|
||||
# DECTalk Voices Reference
|
||||
|
||||
The 9 original DECTalk voices, each with unique characteristics.
|
||||
|
||||
## Voice List
|
||||
|
||||
| Voice | Description | Type |
|
||||
|-------|-------------|------|
|
||||
| paul | Perfect Paul (default, Moonbase Alpha) | Male |
|
||||
| betty | Beautiful Betty | Female |
|
||||
| harry | Huge Harry (deep voice) | Male |
|
||||
| frank | Frail Frank (elderly) | Male |
|
||||
| dennis | Doctor Dennis | Male |
|
||||
| kit | Kit the Kid | Child |
|
||||
| ursula | Uppity Ursula | Female |
|
||||
| rita | Rough Rita (gravelly) | Female |
|
||||
| wendy | Whispering Wendy (soft) | Female |
|
||||
|
||||
## Using Voices in Discord
|
||||
|
||||
### Set Your Voice
|
||||
```
|
||||
[p]ttstoy myvoice paul
|
||||
[p]tts aeiou john madden
|
||||
```
|
||||
|
||||
The voice command `[:np]` is automatically prepended to your text.
|
||||
|
||||
### Override Voice Mid-Text
|
||||
You can use DECTalk commands to change voices within your message:
|
||||
```
|
||||
[p]tts [:nh]I'm gonna eat a pizza. [:dial67589340] Hi, can i order a pizza? [:nv]no! [:nh]why? [:nv] cuz you are john madden![:np]
|
||||
```
|
||||
|
||||
Voice commands:
|
||||
- `[:np]` - Paul
|
||||
- `[:nb]` - Betty
|
||||
- `[:nh]` - Harry
|
||||
- `[:nf]` - Frank
|
||||
- `[:nd]` - Dennis
|
||||
- `[:nk]` - Kit
|
||||
- `[:nu]` - Ursula
|
||||
- `[:nr]` - Rita
|
||||
- `[:nw]` - Wendy
|
||||
|
||||
## Testing Voices
|
||||
|
||||
```bash
|
||||
# Test all voices
|
||||
for voice in paul betty harry frank dennis kit ursula rita wendy; do
|
||||
echo "Testing $voice..."
|
||||
curl "http://127.0.0.1:33001/say?text=Hello%20I%20am%20$voice&voice=$voice" -o "${voice}.mp3"
|
||||
done
|
||||
```
|
||||
|
||||
## In Discord
|
||||
|
||||
```
|
||||
# Set voice and speak
|
||||
[p]ttstoy voice paul
|
||||
[p]tts aeiou john madden
|
||||
|
||||
# Change voice
|
||||
[p]ttstoy voice betty
|
||||
[p]tts Hello, I am Beautiful Betty
|
||||
|
||||
# Override voice in text
|
||||
[p]tts [:nh]Deep voice [:nb]now female voice [:np]back to paul
|
||||
```
|
||||
Reference in New Issue
Block a user