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);
change above line to this: