Files
scrapyard-cogworks/ttstoy/README.md
T
kingston dced723fa0 ttstoy: add Piper TTS provider and accessibility engine selector
- New 'piper' TTS mode backed by a Piper HTTP server (/synthesize),
  wired through the single-mode and multi-voice render paths with the
  same SFX-segment handling as other providers.
- _save_piper_tts renders via POST /synthesize {text, voice}, optional
  model_id voice and dB volume offset.
- Config: piper_api_url (default http://127.0.0.1:5006), piper_voice,
  accessibility_engine (dectalk or piper).
- Commands: ttstoy piperurl, ttstoy pipervoice, ttstoy accessibilityengine.
- Accessibility mode (both the forced-engine command path and the VC
  auto-read listener) now uses the configured engine, dectalk or piper.
- mode command validation/listing/confirmation include piper.
- README documents the piper mode and accessibility engine.
2026-10-18 22:41:26 -05:00

118 lines
4.1 KiB
Markdown

# 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 forces a single robotic/neural engine, disables emoji SFX,
and auto-reads the side chat of the voice channel the bot is in (no command
prefix needed). The first message from a user since someone else last spoke is
prefixed `Name said:`; links, images, and files are announced instead of read.
| Command | Description |
|---------|-------------|
| `[p]ttstoy accessibility` | Toggle accessibility mode |
| `[p]ttstoy accessibilityengine [dectalk\|piper]` | Choose the engine accessibility uses |
## 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)