TooTallNate / node-lame

Node.js native bindings to libmp3lame & libmpg123
MIT License
567 stars 113 forks source link

PCM data as non-interleaved IEEE754 32-bit linear PCM with a nominal range between -1 and +1 #52

Open ouhouhsami opened 9 years ago

ouhouhsami commented 9 years ago

Hi,

Using node-lame, I'd like to be able to get PCM data as non-interleaved IEEE754 32-bit linear PCM with a nominal range between -1 and +1, (in other words 32bits floating point buffer, with each samples between -1.0 and 1.0 - the same used in Web Audio API AudioBuffer).

Is there an easy way to have this representation from the decoder ?

Regards

mdluo commented 6 years ago

A workaround is to use pcm-util to convert the PCM buffer from s16 to f32

mdluo commented 6 years ago

@ouhouhsami

I've forked and implemented setting output format on the decoder:

https://github.com/mdluo/node-addon-mpg123

I will soon submit a PR after some real world testing. See: https://github.com/TooTallNate/node-lame/pull/86

LinusU commented 6 years ago

PR much welcome 👍