]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
common : fix server /inference fails to decode in-memory audio (regression) (#3818)
authorPascal <redacted>
Fri, 22 May 2026 06:27:35 +0000 (08:27 +0200)
committerGitHub <redacted>
Fri, 22 May 2026 06:27:35 +0000 (08:27 +0200)
commit0ccd896f5b882628e1c077f9769735ef4ce52860
tree3f1b8fc4f85b2e6cf7ae44f56a0a9dfe81409bf1
parent8443cf05e3fa8ce1b32348e1bcbcf8fc31f7f3ae
common : fix server /inference fails to decode in-memory audio (regression) (#3818)

* common: add memory buffer overload of read_audio_data

whisper-server /inference without --convert passed the uploaded file
bytes to read_audio_data as a filename, so ma_decoder_init_file tried
to open a path starting with "RIFF" and failed. every request returned
HTTP 400 "Invalid request" on builds without WHISPER_FFMPEG, which is
the default.

factor the PCM extraction into a shared helper and add an overload that
decodes straight from a memory buffer via ma_decoder_init_memory, which
the function already used for the stdin path. server now calls it with
the upload content. the filename overload behavior is unchanged.
examples/common-whisper.cpp
examples/common-whisper.h
examples/server/server.cpp