Writing in HTML5 does not work in Firefox

I use recorder.js and Recordmp3.js to record sound through a microphone.

It works fine in the Chrome browser, but not in Firefox (the latest version also).

When I hit my web application in Firefox, it asks me to exchange a microphone, but after a few seconds it will disappear. Therefore, because of this recording, the function will not be able to record anything in Firefox.

I am using a working example developed using Recordmp3.js and it does not work in Firefox.

http://audior.ec/recordmp3js/

Is this a known issue?

+6
source share
1 answer

I was right, the problem was in the audioStream element for garbage collection, I downloaded the code from github and changed

this is:

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

in

 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); 

so make sure that the stream not garbage collected.

PS :

what should be noted

1: MP3 encoding / decoding technology may be regulated by MP3 patents in some countries. For commercial purposes, I would advise you to go the vorbis/ogg path (also I think that the mp3 quality after converting from wav is bad).

2: I found another problem with an additional 50% silence in the recordings, but a solution for this is already available on the Internet, if I'm right.

Edit: I added a demo for this on github

+2
source

Source: https://habr.com/ru/post/979854/


All Articles