mattdiamond / Recorderjs

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

Changing bit depth to 16-bit WAV #155

Closed skunkwerk closed 8 years ago

skunkwerk commented 8 years ago

Where would I modify the code to support output of 16-bit WAV files, instead of 32-bit?

Doesn't the line following this one set it to 16-bits per sample? Unlike this issue, I'm not concerned with the sample rate or number of channels.

ohtangza commented 8 years ago

I think, you could see floatTo16BitPCM() function (https://github.com/mattdiamond/Recorderjs/blob/master/src/recorder.js) with small header change as well.

As the name suggested, isn't it already 16bit PCM encoded data? (of course, stereo makes id 32bit per samples)

skunkwerk commented 8 years ago

Yup, I just saw that code. I was opening the files in Audacity, which was somehow automatically converting them to 32-bit. But in VLC's media information dialog, it is indeed 16-bit. Sorry about this.

ohtangza commented 8 years ago

No problem. Good to hear that your issue has been resolved. On Tue, Feb 23, 2016 at 2:34 PM, Imran Akbar notifications@github.com wrote:

Yup, I just saw that code. I was opening the files in Audacity, which was somehow automatically converting them to 32-bit. But in VLC's media information dialog, it is indeed 16-bit. Sorry about this.

— Reply to this email directly or view it on GitHub https://github.com/mattdiamond/Recorderjs/issues/155#issuecomment-187568307 .