Thinking it's a bad capacitor.. as I continued to try to fix the thing cause it was driving me insane, the sound started ton happen without the system freezing
In the power supply right?
This motherboard has higher end components solid state and electrolytic caps and I would doubt that one of the smaller electrolytic caps would make such a noise on this motherboard.
I'd run it with the side panel off and when you hear the noise, listen for it coming from the motherboard or rear fan area of the power supply to locate it, but I believe if its a cap making the noise that its 99% with certainty with this motherboard coming from the power supply. If you have the speaker connected to the speaker pins on the motherboard that is where I would look for the sound before the power supply making a noise like this, however many people do without connecting the PC Speaker to the Front Panel Pins on the motherboard, and if its disconnected then the PC Speaker cant be the cause and I'd look at the power supply as the cause.
Lastly.... I have heard of hard drives that make strange noise before failure. The noises can range from a groan, to a buzzing, to a ping sound like a pin ball machine. So with the side panel off of this system when it makes the noise, I'd also check around the hard drive to see if that is the cause. If it is the cause, then backup all data immediately and check into getting a warranty replacement for that drive as for modern drives should be somewhat silent operation.