Failing capacitor somewhere? I’d unplug the computer then do a visual inspection of the motherboard. Look for leaking or bulging capacitors.
Its easy to mistake where the sound is coming from. It might be from the power supply capacitors also, but unless you really know what you are doing, don’t open it up. The capacitors in a psu can hold a large electric charge and are dangerous.