I am asking because I couldn't find the answer anywhere. I have successfully implemented RecorderJS in order to record microphone input in JS. However, the recorded file is WAV which results in large files. I am looking for a way to record with JS directly to MP3, or encode the bits somehow to MP3 instead of WAV.
How can it be done? Is there a Web Audio API function that can do that or JS MP3 encoder of some sort?
The only Javascript MP3 encoder I've seen is https://github.com/akrennmair/libmp3lame-js, which is a port using emscripten. It's supposed to be slow, and I've never used it.
I don't know of any natively-written Javascript MP3 encoders, and encoding is not covered by the Web Audio API.