Closed joanise closed 1 year ago
Good catch. Another example of the horror that is audio on the web... literally nobody uses .webm anywhere else, yet it is the only format that can reliably be produced by the MediaStream Recording API.
Amazingly enough, this lovely API will not tell even you what formats it supports, you have to guess: https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/isTypeSupported
ugh... we can't even produce .mp3 reliably? That ought to be old enough to be everywhere?
Ah, actually, yes, mp3 should work on everybody's browser as long as it's relatively recent: https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Audio_codecs#mp3_mpeg-1_audio_layer_iii
Which would explain why CommonVoice is using it despite its unsuitability for speech data.
Update: 31b6a00b57 in dev.mono-repo branch allows uploading a .webm
file, but if I do that, I get a Error: The audio file could not be loaded
message in Step 2. So we're not done yet with this issue.
Ah, ok - this should be simple enough to solve, as .webm
can definitely be decoded with decodeAudioData and if not there ought to be some third-party libraries on npm that can help us.
This actually should work, but the issue is that when we reupload it, it gets assigned the MIME type video/webm
when it needs to be audio/webm
to be loaded by the web component.
Currently, if you record audio and download it, you get a
.webm
file. But the upload button only supports.mp3
and.wav
so you cannot reupload that file back to use it again.