Recorderjs icon indicating copy to clipboard operation
Recorderjs copied to clipboard

Export to other format than wav

Open JDok opened this issue 11 years ago • 8 comments

Hello,

I tried to export to an other format than wav. I thought, if I would use an other mime type for the Blob the browser convert the data, if the file type is known and supported. But nothing happen. Its always a wav file. I tested the created file with an ogg tool. I know that the filename in the example always ends to wav. Is there any way to export the recorded audio as ogg without implementing an encoding function?

JDok avatar Mar 09 '13 15:03 JDok

Heh. No. Recorderjs has built-in WAV encoding, and any lossy encoding like ogg would be a larger undertaking. Changing the MIME type is irrelevant, the data being returned will always be WAV-encoded.

cwilso avatar Mar 09 '13 16:03 cwilso

Is there any way to use libmp3lame.js to convert the PCM data to MP3?

bibhas2 avatar Feb 13 '14 18:02 bibhas2

you can change .wav to .mp3(whatever you want) inside createDownloadLink() function in javascript

cmohanraj10 avatar Apr 29 '14 10:04 cmohanraj10

This will not produce MP3...

Rudloff avatar Apr 29 '14 10:04 Rudloff

You can changee like this hf.download = new Date().toISOString() + '.mp3'; this recorderjs working in firefox?

cmohanraj10 avatar Apr 29 '14 10:04 cmohanraj10

This will indeed create a .mp3 file, but it will still contain WAV audio.

Rudloff avatar Apr 29 '14 10:04 Rudloff

You should use this script to get mp3. But you'll have to load a new library (+900kb). Think if it's necessary to increase library size.

nazartokar avatar Sep 29 '14 09:09 nazartokar

There is a function of exportWAV() in javascript. It accepts two arguments. First is function and second is format. If you skip second argument it will take wav format by default. But to get audio in another format try to pass "audio/mp3" as second argument to get mp3 format.

vishal5963 avatar Aug 23 '17 05:08 vishal5963