What this thread does
The problem
You add a microphone button to a web app, record with the browser's MediaRecorder, send the blob to OpenAI's transcription API, and it works on desktop Chrome but fails on iPhones with an invalid file format error, or returns text that has nothing to do with what was said.
What people report
These are forum reports, not an official fix; I found no OpenAI statement:
- OpenAI community threads such as Whisper API not transcribing audio files coming from an iPhone, Invalid file format for iOS recording and MediaRecorder API w/ Whisper not working on mobile browsers describe different symptoms. The first has iPhone recordings returning one word or random characters, plus one 400 invalid-format error for webm files from an iPhone. The second is about a native SwiftUI app (AVAudioRecorder, not a browser) getting an invalid-format error. The third has iOS recording from MediaRecorder where audio/webm never finished and audio/mpeg gave a wrong transcript. Safari-recorded mp4 being rejected shows up in an older thread (see below).
- In an older thread, Whisper API cannot read files correctly (March 2023), one poster ran a Safari-recorded file through ffmpeg, which printed "Found duplicated MOOV Atom"; removing the atom by hand did not make the API accept the file, but copying the stream with
ffmpeg -i buffer.mp4 -c copy test.mp4produced a file the API accepted. Another poster in that thread said some ffmpeg versions handle Safari's AAC badly. - Some say passing a timeslice to
mediaRecorder.start()makes Safari produce usable files; others say it did not work for them. In Whisper: problem with audio/mp4 blobs from Safari (2023 to 2024) several posters reportstart(1000)fixed one-to-three-word transcripts, and one who first said it failed later retracted that and wrote that the problem was on the app side; in the iPhone thread above one poster says it fixed it and another says it did not. - Some who got a file accepted still received unrelated text (one iOS report in the mobile-browsers thread: a recording sent as audio/mpeg came back as an unrelated news-style sentence) and fixed it by converting to wav or mp3 first (posters mention a Recorderjs WAV blob, mic-recorder-to-mp3, a Web Audio WAV conversion and ffmpeg on the backend).
- A WebKit bug that may be the one meant, bug 248242, concerned a MediaRecorder video saved as mp4 that the
filetool called application/octet-stream; it was closed as invalid in November 2022 because the olderfileversion did not recognise the format. That was a download check on video, not an upload to a transcription API, so it may not be the same cause.
How to put it to your agent
Our web app records audio with MediaRecorder and sends it to OpenAI transcription. Detect the recorded MIME type (do not assume webm). Upload the raw blob to our server, convert it with ffmpeg to 16 kHz mono wav or mp3, log the original container and the ffmpeg result, and send the converted file to the API. Add a test with a Safari-style mp4 recording and an assertion that the transcript is not empty. If conversion fails, show a clear error to the user.
Mistakes to check
- Hard-coding
audio/webmin the file name or content type. - Converting in the browser on a phone (slow and unreliable); do it on the server.
- Testing only on desktop Chrome.
Limits
Community reports only, nothing run by me; the workarounds are unverified and behaviour may differ on current iOS versions.
Sources
- OpenAI Developer Community threads, each read on 19 Oct 2026: Whisper API not transcribing audio files coming from an iPhone (Feb to Dec 2024), Invalid file format for iOS recording (Dec 2023), MediaRecorder API w/ Whisper not working on mobile browsers (2024), Whisper: problem with audio/mp4 blobs from Safari (Aug 2023 to Nov 2024) and Whisper API cannot read files correctly (the moov atom and ffmpeg posts, read for those mentions only). Checked: what each thread says, matched to the body claims, with corrections above (the three linked threads do not describe rejected Safari mp4; the moov atom report is in the older thread and its first step did not fix the file). None showed an OpenAI staff statement, so "no OpenAI statement" stands for these threads.
- Speech to text guide (OpenAI). Checked: supported input formats mp3, mp4, mpeg, mpga, m4a, wav and webm, files up to 25 MB; it says nothing about browser recordings or format errors. MediaRecorder: mimeType (MDN): mimeType returns the type specified or, if none was specified, the one the browser chose, and a codec not supported by its container may give an unreliable file; the page says nothing about timeslice. WebKit bug 248242: status and reasoning as quoted above.
- Not checked: whether any of these workarounds works on current iOS and Safari versions, or whether the API accepts the files today; the other posts in the long older thread beyond its moov and ffmpeg mentions; whether the WebKit bug above is the one the author meant. The suggested prompt (server-side ffmpeg to 16 kHz mono wav or mp3) is the author's own and I did not run it.
Started from a post by @OpenAI community forum posters, packaged by the editor. Original post