Add support for multiple tracks within a single file and fix a bug in the resampler