Is there a way we could record ogg format in Chrome while working with MediaRecorder ? I believe, Chrome by default supports WebM. Following is what I do
navigator.mediaDevices.getUserMedia({ audio: true })
.then(stream => {
rec = new MediaRecorder(stream);
rec.ondataavailable = e => {
audioChunks.push(e.data);
if (rec.state == "inactive")
{
let blob = new Blob(audioChunks, { 'type': 'audio/ogg; codecs=opus' });
}
};
})
.catch(e => console.log(e));
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…