0

I have used MediaRecorder in one of my project, in starting questions recording is working fine. But after done recording for 4-5 questions, it become very fast on each recording and voice is totally disturbance after 10th recording. Mostly this issue occurs on Firefox version 66, 67. Below is my code:

function mediaIntitialized(){
  var codec = MediaRecorder.isTypeSupported('audio/ogg')?'audio/ogg':'audio/webm';
  recorderVar = polyfilll == 1 ? new MediaRecorder(streamVar) : (recordquality == 0 ? new MediaRecorder(streamVar,{mimeType: codec}) : new MediaRecorder(streamVar,{ mimeType: codec, audioBitsPerSecond: 128000 }));
  //recorderVar.mimeType = 'audio/mp3';
  recorderVar.ondataavailable = function(e) {
      chunks.push(e.data);
  };
  recorderVar.onstop = function(e) {
      var blob = new Blob(chunks,{ 'type' : 'audio/mpeg; codecs=opus' });
      saveRecordedAudio(blob);
      chunks = [];
  };
}
function startRecording() {
  try{
      mediaIntitialized();
      recorderVar.start();
  } catch (e) {
      console.log('errormic: ' + e);
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.