You might want to use sox for this. It would only involve rec -c 1 -r 44100 file.wav as the recording is playing. When you are done with this part of the process, use sox again or ffmpeg to compress and change formats. Hope this helps.