fix a couple bugs in sound buffer resampling