mattdiamond / Recorderjs

A plugin for recording/exporting the output of Web Audio API nodes
4.16k stars 1.46k forks source link

How to export mp3 format ? #181

Open chenweigh opened 6 years ago

Kagami commented 6 years ago

Check out https://github.com/Kagami/vmsg

octavn commented 6 years ago

Recorder.js does not support encoding audio to mp3.

For mp3 check out the vmsg and WebAudioRecorder.js libraries.

kevinjfq commented 5 years ago

When you call this: rec.exportWAV([callback][, type]) just pass 'audio/mpeg' as the 'type' arg.

kevinjfq commented 5 years ago

Hmmm, I think I lied. I told it 'audio/mpeg' but I think the file generated is still a WAV file. :(

kevinjfq commented 5 years ago

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