Open chenweigh opened 6 years ago
Recorder.js does not support encoding audio to mp3.
For mp3 check out the vmsg
and WebAudioRecorder.js
libraries.
When you call this: rec.exportWAV([callback][, type]) just pass 'audio/mpeg' as the 'type' arg.
Hmmm, I think I lied. I told it 'audio/mpeg' but I think the file generated is still a WAV file. :(
Octavian Naicu answered in detail on stackoverflow: "When you send audio/mpeg instead of audio/wav to exportWAV() it just (erroneously) changes the MIME type of the wav Blob, it does not magically turn on mp3 encoding - you need the LAME mp3 encoding library for that. The tutorial you're quoting is incorrect in this regard. I've recently written an up to date Recorder.js tutorial. – Octavian Naicu" https://stackoverflow.com/questions/32138865/how-to-record-audio-in-format-of-mp3-m4a-javascript-recorder-js
Check out https://github.com/Kagami/vmsg