working code for wav files subsampling