capacitors in action.
High pitch sounds or scratchy sound is the reality of capacitors. It is a big issue on desktop computers, especially that more and more desktop computers from manufactures uses quieter fans (as they are cheaper), but even more so in the custom build world, it has always been a big issue, as high end ultra quiet fans (ie: you don't know if the computer is on or off by the sound) are usually used in builds. Not to mention quieter HDD's, or SSD's which has no mechanical part.
Graphics cards, motherboards, and Power supplies are usually the culprit. Many (most) manufacture don't consider the audible sound to be a valid reason for warranty replacement, and won't cover you, because the capacitors despite doing a sound, they don't reduce their life span.
Basically, capacitors always vibrate. It just vibrates at a frequency that we, humans, can hear. A computer might be not making any noise to us, but it might be this annoying high pitch sounding box to a dog, we don't know. Usually, in custom computer builds, people would just return the culprit part, and get another one from a different batch with different (hopefully) batch capacitors that might not vibrate at a
audible level, or from a different manufacture, during the return period, OR sometimes, that doesn't fix it at all, and some other component needs to be changed, as it is the combination of hardware that makes it the capacitor on a hardware output this sound.
And to make matter more complicated, some people have no problem in one place, but when they move, to somewhere else, then they have a high pitch or buzzing or cracking sound, as it is from a different electric grid.
But, so far, all the computers I have had with issues, either be custom build, or manufacture built, nothing broke. My 2005 AMD Athlon 64 X2 4400+ on Socket 939 with 3 GB of DDR1 memory, still work to this day, proudly ran Vista 64-bit above and beyond ('cause the system was actually above specs of Vista, unlike more than half the crap sold at the time to consumers by manufactures), Windows 7, and now Windows 8. My father uses it daily, and a lot. My previous laptop, the Dell Latitude E6400 purchased in 2008, the system does a high pitch sound when the system is idle, on battery, and Windows power plan is set to Power Saver, the sound is reduced when sing Balance, but still
audible (of course, it was
audible if you were up close to the system, with your ear close to the keyboard), the power supply of the laptop does a sound that looks like there is water drops inside and it interfering with the circuitry and boiling when the system is plugged in, not charging (battery fully charged), and the system is sleeping (replaced it 3 times, all did this sound), and it survived to this day. No issue.
My current desktop, I am using a now old GPU, GeForce GTX 260, it does an audible sound that you can hear from the edge of my room, when rendering 2D accelerated content (not 3D, just 2D). If I enable Intel's C1E power saving feature in the BIOS, a feature normally on, the system does a crackling sound when not doing something that genuinely pushes the CPU.
So,
Replace the system if you can, and see if it helps, but if not, this is nothing to worry about, it is part of electronic life, since the longest time.