To expand on this:
It is common when using Windows Audio (WASAPI) to see a message that "input and output devices are set to different sample rates". This is a message informing you that for audio recording to work, you will need to set your input and output devices to the same sample rate. This is done in the Windows control panel. For example:
Here we can see that Windows Audio is selected as the audio driver format:
In the Windows control panel - sound settings, locate the input and output devices in turn and view Properties -> advanced settings:

Here you can see that the playback (output) sample rate is 44.1 khz, and the recording (input) sample rate is 48 khz. This is the source of the problem. Matching the sample rates will solve it and allow you to record audio.
