transcribe: document video support and shallow source lookup
Completes the video-source fix: the command help and README still promised a 25-message scan, and the low-confidence branch was missing the message provenance line the other replies carry.
This commit is contained in:
@@ -1352,7 +1352,7 @@ Transcribe Discord voice messages with Whisper, and optionally translate them wi
|
|||||||
- `[p]translate <language>` - Translate the message you reply to (or text you type), with the source language detected automatically. Add `from <language>` when detection is unsure or you want to be explicit.
|
- `[p]translate <language>` - Translate the message you reply to (or text you type), with the source language detected automatically. Add `from <language>` when detection is unsure or you want to be explicit.
|
||||||
- `[p]transcribeset showoriginal <true|false>` - Show the original text under a translation (default: on).
|
- `[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`).
|
Reply to a voice message or video, or attach one to the command. Running the command bare uses the message posted immediately before it - it never reaches further back, so it cannot quietly transcribe an older clip. Audio and video attachments are accepted (`ogg`, `opus`, `wav`, `mp3`, `m4a`, `flac`, `aac`, `wma`, and the video containers `mp4`, `mov`, `m4v`, `mkv`, `webm`, `avi`, `mpeg`, `mpg`); Whisper decodes the audio track out of video files. Each reply names the message it transcribed.
|
||||||
|
|
||||||
The cog talks to two local services:
|
The cog talks to two local services:
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ MAX_TRANSLATE_CHARS = 8000
|
|||||||
# send videos expecting them to be transcribed.
|
# send videos expecting them to be transcribed.
|
||||||
MEDIA_EXTENSIONS = (
|
MEDIA_EXTENSIONS = (
|
||||||
".ogg", ".opus", ".wav", ".mp3", ".m4a", ".flac", ".aac", ".wma",
|
".ogg", ".opus", ".wav", ".mp3", ".m4a", ".flac", ".aac", ".wma",
|
||||||
".mp4", ".mov", ".m4v", ".mkv", ".webm", ".avi",
|
".mp4", ".mov", ".m4v", ".mkv", ".webm", ".avi", ".mpeg", ".mpg",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Below this, Whisper is guessing which language it heard. Translating from a
|
# Below this, Whisper is guessing which language it heard. Translating from a
|
||||||
@@ -339,8 +339,8 @@ class Transcribe(commands.Cog):
|
|||||||
async def transcribe(self, ctx: commands.Context, *, language: Optional[str] = None):
|
async def transcribe(self, ctx: commands.Context, *, language: Optional[str] = None):
|
||||||
"""Transcribe a voice message, or translate it into another language.
|
"""Transcribe a voice message, or translate it into another language.
|
||||||
|
|
||||||
Reply to a voice message, or just run it and the most recent one in the
|
Reply to a voice message or video, or attach one to the command. Running
|
||||||
channel is used.
|
it bare uses the message posted immediately before it.
|
||||||
|
|
||||||
**Examples**
|
**Examples**
|
||||||
`[p]transcribe` — transcribe and translate to English
|
`[p]transcribe` — transcribe and translate to English
|
||||||
@@ -415,6 +415,7 @@ class Transcribe(commands.Cog):
|
|||||||
f"I only detected **{self._label(detected)}** "
|
f"I only detected **{self._label(detected)}** "
|
||||||
f"({confidence:.0%} confident), so I won't translate from a guess.\n"
|
f"({confidence:.0%} confident), so I won't translate from a guess.\n"
|
||||||
f"{self._clip(source_text, 1600)}"
|
f"{self._clip(source_text, 1600)}"
|
||||||
|
f"{origin}"
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user