I am using recorder.js and Recordmp3.js for recording audio through microphone.
It's working fine in chrome browser but not in Firefox(Latest version as well).
When I hit my web app on the Firefox browser, It asks me to share microphone but after few seconds It gets disappeared. So because of that recording feature not be able to record anything on Firefox.
I am sharing on working example developed using Recordmp3.js and It's not working in Firefox.
http://audior.ec/recordmp3js/
Is this a known issue?
Firefox handles many types of audio and video content on web pages, and can also open links to MP3 files and some other types of media.
Firefox is not playing videos caused due to some minor problems or settings of your browser. You can quickly fix this problem by using various fixes such as updating the Firefox, Refreshing the browser, disabling the extensions, clearing the cache files, etc.
Check the Volume Mixer Click the volume icon in the Windows taskbar. Click Mixer Mixer. The Volume Mixer window will appear. Make sure the slider for Mozilla Firefox is not muted or at the bottom.
Firefox has built in support for open media formats usually associated with MP3, WebM, Ogg and Wave containers. However, MP4 containers usually depend on platform decoders for AAC and H. 264 audio and video streams.
I was correct, the problem was audioStream element to garbage collected, I downloaded the code from github and modified
this:
var audio_context;
var recorder;
function startUserMedia(stream) {
var input = audio_context.createMediaStreamSource(stream);
into
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);
hence making sure that the stream
is not garbage collected.
P.S :
things to note,
1 : MP3 encoding/decoding technology may be governed by MP3 patents in some countries. For commercial purposes, I would advice you to go for vorbis/ogg
way( also I think the quality of mp3 after conversion from wav is bad).
2 : I found another problem of extra 50% of silence in the recordings, but the solution for that is already available online if i am correct.
Edit: I have added a demo for this in github
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With