Add Transcribe cog

Voice messages become text via the local whisper-server, with optional
translation through nllb-server. English uses Whisper's own translate task so
the common case needs no second model; other targets transcribe first and
translate after, and skip translation when Whisper's language confidence is
too low to trust.
This commit is contained in:
2026-11-02 15:44:47 -06:00
parent f3da940d0f
commit 51932b1cd7
4 changed files with 393 additions and 0 deletions
+20
View File
@@ -45,6 +45,9 @@ Homepage: https://homepage.kingstons-scrapyard.net/
- [Web UI](#web-ui)
- [MiniMax Voices (Presets)](#minimax-voices-presets)
**Transcribe**
- [Transcribe](#transcribe)
---
## Installation
@@ -1339,3 +1342,20 @@ Rename users with admin-only commands.
- `[p]renamer rename <member> [nickname]` - Rename a member. Leave nickname empty to clear it (admin only).
- `[p]renamer bulkrename <members...> <nickname>` - Rename multiple members to the same nickname (admin only).
- `[p]renamer massrename <role> <nickname>` - Rename all members with a specific role (admin only).
## Transcribe
Transcribe Discord voice messages with Whisper, and optionally translate them with NLLB. Both models run locally, so no audio leaves the machine and there is no cloud API to pay for.
- `[p]transcribe` - Transcribe the message and translate it into English.
- `[p]transcribe <language>` - Translate into another language, by English name (`french`) or ISO code (`fr`).
- `[p]transcribeset showoriginal <true|false>` - Show the original text under a translation (default: on).
Reply to a voice message, or just run the command and the newest voice message within the last 25 messages is used. Attachments are accepted too, as long as they are audio (`ogg`, `opus`, `wav`, `mp3`, `m4a`, `flac`, `webm`).
The cog talks to two local services:
- `whisper-server` on `127.0.0.1:8201` for speech to text (faster-whisper, CPU)
- `nllb-server` on `127.0.0.1:8200` for translation (NLLB-200, GPU)
English needs only the first one: Whisper's own `translate` task handles it in a single pass. Everything else transcribes first, then translates. If Whisper is less than 50% confident about which language it heard, the cog prints the transcript and skips the translation rather than translating a guess.