Hmm, that didn’t seem to help, both when saving it to /temp and just using BytesIO. I am thinking that maybe it has something to do with dependencies. I have installed both opus-tools, libopus0, and ffmpeg but that didn’t do nothing either. I am gonna try to convert it to a different format with ffmpeg firs, maybe that is gonna work
I pretty much only use wave files. But I hear it can be finicky on exact formats. So convert it to a know “good” format, then troubleshoot from there.
After much trying and researching the problem was a mix of 2 issues:
a) In order for the Whisper API to work, the buffer with the audio-bytes has to have a name (which happens automatically when you write and read it to the file, just make sure you have the right extension).
b) The AWS API-Gateway doesn’t support binary data in requests by default, and you have to manually allow it. F.e. if you are using Serverless Framework for deployment add this: