WebRTC Audio Recording using MediaStreamRecorder

HOME © Muaz Khan . @WebRTCWeb . Github . Latest issues . What's New?

Star 2,651 Fork 562Follow @muaz-khan3,714
Last Updated On:
ms

recorderType:


How to use?

// cdn.webrtc-experiment.com/MediaStreamRecorder.js

var mediaConstraints = {
    audio: true
};

navigator.getUserMedia(mediaConstraints, onMediaSuccess, onMediaError);

function onMediaSuccess(stream) {
    var mediaRecorder = new MediaStreamRecorder(stream);
    mediaRecorder.mimeType = 'audio/webm'; // audio/webm or audio/ogg or audio/wav
    mediaRecorder.ondataavailable = function (blob) {
        // POST/PUT "Blob" using FormData/XHR2
        var blobURL = URL.createObjectURL(blob);
        document.write('<a href="' + blobURL + '">' + blobURL + '</a>');
    };
    mediaRecorder.start(3000);
}

function onMediaError(e) {
    console.error('media error', e);
}

Latest Issues

Get audio blob on demand explicitly.


Is there a function similar to recordRTC's recorder.getBlob() function so I can get the recorded audio in a bl...

exact sync of video and audio


Can we guarantee to record the video stream and audio stream in the exact sync mode? As I know, hardware and digital processing ca...

Latest Updates

Fixed #143 Updated dev/MultiStreamRecorder
Merged & closed #137