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 or here I had changed the setting once, but it got lost when I did some upgrades and rebooted.