Check this source:
VC++ Example: Classes to Record, Play, and Save WAV File to disk[
^]
"With these classes, sound can be both recorded and played at the same time. Continuous sound can be monitored and, upon appropriate queues, sound can be played back. Simple sound recognition could also, for instance, be put into CRecordSound. The multithreading allows other actions to take place while sound recording and playback go on. As well, recorded sound can be saved to WAV files and played back."