Sample Code for audio recording and playing using buffers