njh / twolame

MPEG Audio Layer 2 (MP2) encoder
http://www.twolame.org/
GNU Lesser General Public License v2.1
59 stars 34 forks source link

Floating point input samples and libsndfile (not a bug) #95

Open eblanca opened 4 years ago

eblanca commented 4 years ago

Just for you to know (can't remember whether I mentioned this before). When libsndfile opens a floating point input file, its default behaviour is to scan the whole file and set an amplitude value so the input peak will be mapped to 1.0 This may result in an amplification (most of the cases) or an attenuation of the input signal, that is the input data get modified. I really think this shouldn't happen and I filed Erik a pull request here some time ago, in a way calling applications can set an amplitude value (most likely to be 1.0) so the input signal WON'T be changed. This has not been merged yet, so as of today any time one wants to encode some content as floating point values, then this is what will happen. Does this deserve a mention into README ?