How can I record audio from the microphone with ffmpeg?

Please take a look at this Wiki: FFmpeg / Capture / Desktop

You can list your devices with:

ffmpeg -list_devices true -f dshow -i dummy