Audacity records at wrong clock rate

I just ran into a problem like this (1:00 of music recorded as 1:05) on Ubuntu 14.04 with Audacity 2.0.5 (2.0.5-1ubuntu3.2) and pulse audio. The solution turned out to be using the “Monitor” capture setting from pulse audio as shown here http://manual.audacityteam.org/man/tutorial_recording_computer_playback_on_linux.html or here https://www.maketecheasier.com/record-system-sound-linux. I had changed the setting once, but it got lost when I did some upgrades and rebooted.