I am recording audio from getUserMedia({audio:true});
in the browser using Recorder.js and then exporting it as a WAV file because that's the only option the library provides.
A 1 minute 20 seconds file is 14.1 MB large. I need to upload the audio to a server and I need to do it fast. How do I convert the WAV audio in any other compressed format to lower the file size?
I don't mind converting to:
If there is no way as of now to convert to any of these formats, how can I compress the WAV file on the client?
PS: I did a lot of searches to find anything that converts WAV in JS, but found nothing. libmp3lame.js isn't working in Chrome.
Thanks!
Though a WAV file can contain compressed audio, the most common WAV audio format is uncompressed audio in the linear pulse-code modulation (LPCM) format. LPCM is also the standard audio coding format for audio CDs, which store two-channel LPCM audio sampled at 44,100 Hz with 16 bits per sample.
Click "Compressed (zipped) Folder." Windows creates a new zip folder whose name matches your WAV file's name. The folder also has a ZIP file extension. You'll see this folder in the same folder that contains your WAV file. Right-click that folder and select “Properties” to view the folder's size.
The only way to reduce the size of a wav file is to resample it to a lower bit rate or use less bits per sample. Wav files don't have compression capabilities like mp3 or ogg.
The browser will choose the first source it supports. The text between the <audio> and </audio> tags will only be displayed in browsers that do not support the <audio> element. There are three supported audio formats in HTML: MP3, WAV, and OGG.
I've made an audio recorder that records to mp3 directly from the browser combining RecorderJS and libmp3lame.js
You can find the gitHub project here: https://github.com/nusofthq/Recordmp3js
and a more detailed explanation of the implementation: http://nusofthq.com/blog/recording-mp3-using-only-html5-and-javascript-recordmp3-js/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With