fix format converter functions for >= 1024 samples.

fixes #6 - thanks to Alex Stark