mediarecorder

Have you ever wondered how you can record your microphone using javascript? Since the MediaRecorder api landed in browsers it became very easy to do so. To start we'll need to get access to the microphone. We can do this by using the getUserMedia method. navigator.mediaDevices.getUserMedia({audio: true}).then(stream => { // All went well, here is an audio-stream of your microphone }, error => { // Oops, something went wrong or your browser does not support mediaDevices.getUserMedia }); Calling getUserMedia will return a promise, which when resolved will return an audio-stream of your microphone. We will need this stream when creating…