3.0 KiB
3.0 KiB
Testing DECTalk Server with TTSTOY
Quick testing guide to verify everything works.
Step 1: Start the DECTalk Server
cd ~/Desktop/ttstoy/dectalk-server
PORT=3001 npm start
You should see:
DECTalk TTS Server running on http://localhost:3001
Health check: http://localhost:3001/health
Simple API: http://localhost:3001/say?text=Hello
MiniMax-compatible API: POST http://localhost:3001/v1/t2a_v2
Step 2: Test the API Directly
Open a new terminal and test:
# Test health check
curl http://127.0.0.1:3001/health
# Test simple endpoint (saves to test.mp3)
curl "http://127.0.0.1:3001/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:3001/v1/t2a_v2 \
-H "Content-Type: application/json" \
-d '{"text": "Testing DECTalk compatibility", "voice_setting": {"voice_id": "default"}}' \
| jq '.base_resp'
Expected output:
{
"status_code": 0,
"status_msg": "Success"
}
Step 3: Configure TTSTOY
In Discord:
[p]ttstoy dectalkurl http://127.0.0.1:3001
[p]ttstoy mode dectalk
[p]ttstoy mode
You should see:
Current TTS Mode: 🤖 DECTALK
DECTalk API URL: http://127.0.0.1:3001
Step 4: Test TTS in Discord
[p]tts Hello, I am DECTalk, a text to speech system.
The bot should:
- Generate audio using DECTalk
- Upload the MP3 file to Discord
- 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)
# Find what's using port 3001
lsof -i :3001
# Use a different port
PORT=3002 npm start
# Update TTSTOY
[p]ttstoy dectalkurl http://127.0.0.1:3002
"Cannot reach DECTalk API"
- Check server is running:
curl http://127.0.0.1:3001/health
-
Check server logs in the terminal where you started it
-
Verify URL in TTSTOY:
[p]ttstoy dectalkurl
Audio not playing
- Make sure ffmpeg is installed:
ffmpeg -version
-
Check bot logs for errors
-
Test the
/sayendpoint directly and play the audio
"say: command not found" (Linux)
The current server uses macOS say command. On Linux, you need to:
- Install actual DECTalk or use espeak:
# Option 1: espeak (simple)
sudo apt install espeak
# Option 2: Install dectalk-tts
npm install -g dectalk-tts
- Modify
server.jsto use the appropriate command
Success Checklist
- DECTalk server starts without errors
/healthendpoint returns{"status": "ok"}/sayendpoint generates audio file- TTSTOY mode switches to dectalk
[p]ttscommand works in Discord- Audio plays in voice chat
- Emoji SFX work correctly
Next Steps
Once everything works:
- Set up auto-start with systemd or PM2
- Configure firewall if needed
- Consider using actual DECTalk binary for authentic voice
- Add cleanup for old audio files in output/