swarm-stt: only files that start like an audio container reach ffmpeg
This commit is contained in:
parent
f8e1d0fbbd
commit
33e63091d5
1 changed files with 97 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue