move resampling to separate file
reorganize code
generalize code to work with 1 channel stream