Whenever I go to play certain games (mainly Doom Eternal) my pc starts making an odd whining noise, that changes based on what's happening in game. At first I thought it was a hard drive issue, but after taking all my hard drives out and just using my ssd, the whine is still there. Now I think it could be my gpu, but it doesn't happen in all games, so I'm not sure why Doom Eternal would cause an issue like this, and not other titles. Here is a recording of my pc while playing. (For context, my computer is nearly silent in all other games.)
Specs:
Windows 10 Pro 64 bit
MSI MPG Z390 Gaming Plus
Intel i7-8700K (stock speeds)
MSI RX 5700
2x8GB Corsair Vengance 3200MHz
Intel 660p SSD
Corsair CX650 (power supply)
pc whine.mp3