Pass in the left shifted values (0x20000 for the first parameter). In an attempt to make it a bit easier to remember, sample magnitudes are just raw, and (possibly) fractional values are expressed as fixed point, with 16 bits to the right of the point.

Richard.