Recording audio in browser
With advancements in HTML5, audio recording in browser is now easier than before. Even though the underlying technologies, Web Audio API + WebRTC, is not fully supported across browsers, it is a better alternative to having users install addons or download extensions to enable audio recording in browser.
In it’s simplest form, getUserMedia is used to capture audio for Web Audio to then record. But of course, you know it’s more complicated than that. Good news is RecorderJs has done all the necessary work.
There are 2 minor issues with the final working script in that article though. One, it uses an old version of Recorderjs and hard-coded the channel as 1 in several parts of the source. The other issue is with libmp3lame. The converted mp3 file is twice the length of the original recording, with the other half blank. I created a fork that fixed both. I actually didn’t do anything super. I just recreated using a newer version of Recorderjs, commented out a line causing audio feedback and made a tiny tweak in the libmp3lame source as recommended in a comment. You can check out the fork here: github.com/kehers/Recordmp3js
If you are interested in where this experiment leads, follow me on Twitter (@kehers) to follow what I am working on. I promise you will love it :)