QUOTE(Madman2003 @ Feb 11 2007, 15:19)

I'm trying to implement wavpack into a music player, and i've got all the integer modes working nicely, but floating point remains distorted. Are there special considerations to be made that aren't mentioned in lib_use.txt?
Since you're looking at lib_use.txt I assume you're not using the "tiny decoder" which now automatically handles float data. In the standard library you need to convert the float data back into integers yourself. Assuming that you use the OPEN_NORMALIZE flag and set "norm_offset" to zero, the buffer will come back with 32-bit floating data in the range of +/- 1.0, although you will still have to clip it because float data may exceed 0 dB.
Something like this would be the simplest to convert to 16-bit integers in place:
CODE
int32_t *lptr = buffer;
while (num_samples--) {
float fdata = * (float*) lptr;
if (fdata > 1.0) fdata = 1.0;
if (fdata < -1.0) fdata = -1.0;
*lptr++ = (int32_t) (fdata * 32767.0);
}
You can also use the "norm_offset" parameter to scale the values for you. For example, I use 23 in the winamp plugin to have the values returned in the same range as 24-bit integers (although they still must be clipped and converted, just not scaled).
Good luck and thanks for implementing WavPack support!