Okay, I'm getting audio from the MediaRecorder as follows:
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia(
// constraints - only audio needed for this app
{
audio:
{ sampleSize: 16, channelCount: 1, sampleRate: 16000 }
})
// Success callback
.then(function (stream) {
mediaRecorder = new MediaRecorder(stream);
mediaRecorder.ondataavailable = function (e) {
if(e.data)
socket.send(e.data);
}
streamstart();
}) ...
As I understand, this data available in the callback contains a WebM audio format with opus encoding (Chrome). This I'm sending to my Win32 application in order to transfer the sound from the phone's microphone to it.
Now, I could use libebml to decode this information, but, is there any way to get the raw opus data bytes from it (i.e. to decode in JavaScript)? To avoid wasted bandwidth.
I believe that Opus Media Recorder can't help , it simply converts any sort of non-opus to Webm-based opus, not raw opus stream.