How to record audio from mic

Hi everyone!

Is there any proper way and full documentation from which i can record the audio from mic and it will save, while playing the game?