I am trying to record audio in a webm container using MediaRecorder
in Firefox. The exact mime type I’m going for is "audio/webm;codecs:vp9
which should be supported according to:
MediaRecorder.isTypeSupported("audio/webm;codecs:vp9") // outputs true
Currently, I use the following code to record the audio:
const mediaRecorderRef = new MediaRecorder(stream, {
mimeType: "audio/webm;codecs:vp9"
});
mediaRecorderRef.start(1000);
mediaRecorderRef.current.ondataavailable = (e) => {
// storing all chunks
};
After the recording, I create one big blob from the audio chunks as follows:
new Blob(audioChunks, { type: "audio/webm;codecs:vp9" })
Unfortunately, something is wrong with the created audio as I can not play it back. Recording and playing back audio does work on Chrome however.
I saw the same behavior using different codecs with the webm
container in Firefox. Recordings did work using an ogg
container, though this is not the format that I need.
Is it possible to record audio in a webm
container in Firefox? If so, what is the issue with my current solution?