If your computer sometimes make a high pitched whining sound it may suffer from "Coil Whine".
Coil whine is a sound that is produced by micro vibrations in the coils in the power circuits. The sound typically varies depending on the amount of power consumed by the computer. It often becomes worse when the computer is idling. Coil whine can be very annoying in a quiet environment, especially if you have good hearing.
Coil whine in a new computer is a factory defect caused by sub-standard components or assembly and is usually covered by the warranty. Coil whine can also occur or become more pronounced in old computers due to degradation of the components. If this happens you can try to replace the whining part.
As a last resort you can try this little Windows program called KillCoilWhine. Download it and put it on the desktop. Next time the computer starts whining, simply start the program and the whining sound should stop. The program works by preventing the computer from idling. It will not slow the computer down, but it will increase the power consumption. Do not use this program if you are running your computer on batteries, as you will run out of battery more quickly.
The program is free to download and use. It runs in the background and does not display anything. It will be active until you restart your computer.