lamejs
lamejs copied to clipboard
Document usage with Float32Array / AudioBuffer
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.
Thanks @cdauth .