Recording skips a bit at the beginning

I’m trying to record audio played back on a website. Capturing it with other tools is very complicated and I’d just like to record it while it’s playing. I need it as a .wav file anyway.

I’ve selected the WASAPI device and selected my speakers as source. I’ve tried it with either the analogue speakers as well as the S/PDIF digital output (each configured as default playback device in Windows for the process). The project sample frequency is 44.1 kHz and 16 bit. When I hit the record button, nothing happens at first. As soon as I start the playback on the website, the recording starts. The recording itself is good, but right at the beginning, at around 2.0 sec, a short part is missing. The recording skips about half a second of the played back audio. The rest of the recording has no skips. This is 100% reproducible, it happens every time I try at exactly the same position.

Audacity 2.2.0
Windows 10.1709 x64
Audio drivers from Windows Update

The last time I recorded something from a website, I didn’t notice this problem. Also, the recording started immediately when I pressed the record button, not just when I started the playback. That was with Audacity 2.1.3 on Windows 10.1607 x64, like a week ago. I recently reinstalled my OS.

Update: I’ve found out that this issue does not occur when I set my project sample rate to 48 kHz before recording. Since I need 44.1 kHz output, I have to convert the sample rate once before saving to file.

Open the Windows Sound Control Panel and find the sample rate for the device that you are using. Set that to 44100 so that it matches the setting that you want to use in Audacity.