vvsanil
vvsanil

Reputation: 65

How do I extract and record audio in webRTC on Firefox?

I implemented one to one webRTC video chat (Both audio and video)

navigator.getUserMedia({
    audio: true,
    video:true
  }, function (stream) {

  }, function(err){
})

But i want to record only audio of the chat session. In chrome i am able to record by using RecordRTC, But in Firefox i am getting video+audio file (webM).

How do I extract audio in Firefox from audio+video stream?

Upvotes: 1

Views: 1481

Answers (1)

mido
mido

Reputation: 25054

you have one of two ways to do it, when you make new recording, you do new RecordRTC(stream, config):

  • currently the stream you are passing must be videostream, you can change it to audiostream as stream.getAudioTracks()[0], I have not tried this, but guessing that it should work.

  • or as part of config, add an attribute recorderType: window.StereoRecorder, now it would use StereoRecorder and not firefox's own MediaStreamRecorder.

p.s: have you tried recording remote stream in chrome, because chrome supports recording only stereo mode and webrtc provides audio in mono mode.

Upvotes: 0

Related Questions