after 5 seconds recording stopped in mozilla but working fine in chrome

55 Views Asked by At

HTML5 Microphone capture stops after 5 seconds in Firefox. It is working fine in Chrome. I have taken this code from Github.

var audio_context;
var recorder;
var localStream; // line added by me

function startUserMedia(stream) {
    localStream = stream; // line added by me
    var input = audio_context.createMediaStreamSource(stream);
1

There are 1 best solutions below

0
On
var audio_context;
var recorder;

function startUserMedia(stream) {
var input = audio_context.createMediaStreamSource(stream);

change above line to this:

var audio_context;
var recorder;
var localStream; // line added by me

function startUserMedia(stream)  {
localStream = stream; // line added by me
var input = audio_context.createMediaStreamSource(stream);