How derpeloper/ostinato works
Ostinato is a Discord voice bot that turns server messages into speech. The main path is message/event handling through TTS policy and per-server queuing, worker inference, then audio playback in a voice channel; commands also configure voices, language, speed, filters, and other server behavior. Persistent preferences use SQLite, and command text is localized. The README documents the worker-pool and audio pipeline; several runtime files are represented from the source index, so unshown implementation links are omitted where their ownership is unclear.
Main entry points: OstinatoTTS.js TTS service · index.js Bot entry · ttsWorker.js TTS workers · public User commands
Components 15
Discord runtime
- Bot entry
src/index.js - Event handlers
src/events
Commands and settings
- User commands
src/commands/public - Moderator commands
src/commands/mods
Speech pipeline
- TTS service
src/services/OstinatoTTS.js - TTS workers
src/services/ttsWorker.js - Supertonic engine
src/engine/helper.mjs - Text cleanup
src/utils/cleanText.js - Voice styles
src/assets/engine/voice_styles - FFmpeg audio
Persistence and language
- Runtime config
src/config.js - SQLite settings
src/data/db.js - Translations
src/localization/localize.js
Other components
- Server user
- Discord
Connections 20
- Server user → Discord: sends messages
README.md - Discord → Bot entry: delivers events
README.md - Bot entry → Event handlers: loads handlers
src/index.js - Bot entry → TTS service: initializes
src/index.js - Bot entry → User commands: loads commands
- Bot entry → Moderator commands: loads commands
- Event handlers → TTS service: requests speech
src/events/tts.js - User commands → SQLite settings: reads/writes
src/commands/public/name.js - Moderator commands → SQLite settings: reads/writes
src/commands/mods/message.js - User commands → Translations: gets translations
src/commands/public/name.js - Moderator commands → Translations: gets translations
src/commands/mods/message.js - TTS service → SQLite settings: reads settings
src/services/OstinatoTTS.js - TTS service → Runtime config: uses config
src/services/OstinatoTTS.js - TTS service → Text cleanup: cleans text
src/services/OstinatoTTS.js - TTS service → TTS workers: dispatches jobs
README.md - TTS workers → Supertonic engine: loads engine
src/services/ttsWorker.js - TTS workers → Voice styles: loads styles
src/services/ttsWorker.js - TTS workers → FFmpeg audio: produces audio
README.md - FFmpeg audio → Discord: streams to voice
README.md - Discord → Server user: plays speech
README.md