erikd/libsndfile — pull request #22 by thomasthiriez (2012-10-27 00:03:58+00:00)
Title: Fix: a float value close to 1 becomes -1 when encoded with alaw or ulaw.

When using `sf_writef_float` to create an alaw encoded file, the float values greater than 0.999786 (= 2047.5 * 16 / 32767) are wrapped, and become close to -1 in the encoded audio.

This is due to a bad value in the last slot of the alaw_encode table. This bad value is never used when the source audio is in an integer format. Only with floating point values.

A similar problem is present with the ulaw codec.