Added record pcm function