I use MediaRecorder to record audio from web browser and send it to the server via socket.io:
var recorder;
navigator.mediaDevices.getUserMedia({ audio: true video: false }).then(
(stream) => {
recorder = new MediaRecorder(stream, { mimeType: "audio/webm" });
recorder.ondataavailable = function(event) {
console.log(event.data) // Blob {size: 6478, type: 'audio/webm;codecs=opus'}
// blob size is 6478, but should be 48000
}
}
);
recorder.start(1000);
I set time slice of recording to 1000ms: recorder.start(1000); The device sample rate is 48000Hz. So every 1s I must send 48000 samples to the server. But as I see, there are just ~6000 samples every second. Could you please help with this problem and how to resolve it?