extracting wav samples from a buffer