Watch
0
0
Fork
You've already forked hyperhive
0

swarm-stt: only files that start like an audio container reach ffmpeg

This commit is contained in:
damocles 2026-11-11 22:28:32 +01:00 • committed by mara
commit 33e63091d5

View file

@ -31,7 +31,9 @@ into place with a rename, so a reader never sees half a transcript.
The `Engine` trait takes bytes and returns text. `Whisper` is the real one:
`ffmpeg` decodes any container to 16 kHz mono WAV, cutting it at `max_secs`,
and `whisper-cli` from whisper.cpp reads the WAV with the configured model and
language detection on. Decoding is pipe-only (`-protocol_whitelist pipe`): the audio comes from
language detection on. Before anything decodes, `sniff` checks that the file starts like an audio
container (Ogg, WAV, FLAC, MP3, AMR, MP4 or M4A, WebM); the daemon refuses a playlist, an image or a
script without starting `ffmpeg`. Decoding is pipe-only (`-protocol_whitelist pipe`): the audio comes from
rooms with outside people, so a file that names other files or URLs gets no
way to open them. The service kills a run that outlasts its timeout (decode and transcribe
together) and fails the request, so one hung child can't hold the single