#728·llamafile

Bug: Error when parsing wav file that ffmpeg understands

Author: TomatoCoCreated Mar 23, 2025Updated Jun 6, 2026
Labelsbugmedium severity

Contact Details

[email protected]

What happened?

This problem might be my own fault, because I've written code that converts PCM samples directly to the wav-format that whisper requires, but I am getting the error /C/Users/USERNAME/AppData/Local/Temp//whisperfile.5925872593102731025: failed to read pcm frames from audio file: At end otalerror: failed to read audio file when I pass my file to it. Very few of the files my code creates fail. But ffmpeg can convert it, and VLC plays it just fine, so I think there's a non-zero chance it's actually whisperfile's fault?

Anyway, I start whisper in server mode with .\whisperfile-0.9.1.exe --server -m .\whisper\ggml-tiny-q5_1.bin and I send this file to it with curl 127.0.0.1:8080/inference -H "Content-Type: multipart/form-data" -F file="@output-bad.wav" -F temperature="0.0" -F temperature_inc="0.2" -F response_format="json"

Attached is the file that causes this problem. Again, there might be something with my encoder, but other well-known software seems to understand my file just fine and I can't figure out what I'm doing wrong so I figure there's a low chance that I'm actually creating a valid wav.

output-bad.zip

Version

whisperfile v0.9.1

What operating system are you seeing the problem on?

Windows

Relevant log output

bash
whisper_init_from_file_with_params_no_state: loading model from './whisper/ggml-tiny-q5_1.bin'
whisper_init_with_params_no_state: cuda gpu   = 0
whisper_init_with_params_no_state: metal gpu  = 0
whisper_init_with_params_no_state: flash attn = 0
whisper_init_with_params_no_state: gpu_device = 0
whisper_init_with_params_no_state: dtw        = 0
whisper_model_load: loading model
whisper_model_load: n_vocab       = 51865
whisper_model_load: n_audio_ctx   = 1500
whisper_model_load: n_audio_state = 384
whisper_model_load: n_audio_head  = 6
whisper_model_load: n_audio_layer = 4
whisper_model_load: n_text_ctx    = 448
whisper_model_load: n_text_state  = 384
whisper_model_load: n_text_head   = 6
whisper_model_load: n_text_layer  = 4
whisper_model_load: n_mels        = 80
whisper_model_load: ftype         = 9
whisper_model_load: qntvr         = 1
whisper_model_load: type          = 1 (tiny)
whisper_model_load: adding 1608 extra tokens
whisper_model_load: n_langs       = 99
whisper_model_load:      CPU total size =    31.57 MB
whisper_model_load: model size    =   31.57 MB
whisper_init_state: kv self size  =    9.44 MB
whisper_init_state: kv cross size =    9.44 MB
whisper_init_state: kv pad  size  =    2.36 MB
whisper_init_state: compute buffer (conv)   =   13.45 MB
whisper_init_state: compute buffer (encode) =   85.79 MB
whisper_init_state: compute buffer (cross)  =    4.14 MB
whisper_init_state: compute buffer (decode) =   96.15 MB

whisper server listening at http://127.0.0.1:8080

Received request: output-bad.wav
/C/Users/USERNAME/AppData/Local/Temp//whisperfile.5925872593102731025: failed to read pcm frames from audio file: At end       otalerror: failed to read audio file