lamejs icon indicating copy to clipboard operation
lamejs copied to clipboard

Document usage with Float32Array / AudioBuffer

Open cdauth opened this issue 3 years ago • 1 comments

It seems that many people are running into problems when trying to use lamejs with a Float32Array. This kind of array is created by the WebAudio API, and I believe libmp3lame-js was also expecting that format.

The README does not really indicate what data format lamejs expects. That’s why I have added a section that explains what format is expected and how to convert a Float32Array to it. In the example I have used an Int32Array because using an Int16Array (like in the other examples) resulted in serious clipping for me.

As a further step, I think it would be nice if lamejs could deal with a Float32Array out of the box, which would save time and resources by making the mapping unnecessary.

cdauth avatar Apr 25 '21 14:04 cdauth

Thanks @cdauth .

AnshVM avatar Jan 22 '22 10:01 AnshVM