MediaSource.isTypeSupported("audio/webm")
MediaRecorder.isTypeSupported("audio/webm")
It is really hard to tell what kinds of audio you can record and playback in the various browsers.
Here is data as of 2024.05.30
MediaRecorder.isTypeSupported | Chrome | Safari | Firefox |
---|---|---|---|
audio/mpeg | false | false | false |
audio/webm | true | false | true |
audio/mp4 | false | true | false |
No one support recording in audio/mpeg, aka mp3. audio/webm is the best supported with fallback to audio/mp4
MediaSource.isTypeSupported | Chrome | Safari | Firefox |
---|---|---|---|
audio/mpeg | true | true | false |
audio/webm | true |
true | true |
audio/mp4 | false | true | true |
Chrome is misleadingly reporting false
because I can both record and source in audio/webm
.
On the webkit site it mentions it only support mp4
This API can be feature-detected, as can the set of supported file/container formats and audio/video codecs. Safari currently supports the MP4 file format with H.264 as video codec and AAC as audio codec. MediaRecorder support can be checked as follows:
It could make sense to default to aaudio/webm
with fallback to audio/mp4
.