|Sounds like your Power Supply. If the coils in the transformer begin to fuse because the coating wears off then it will make a high pitch sound and it will change the power output shutting your computer down. This is caused by it heating up and the coil begin to expand do to the heat. Is the Fan on your power supply working correctly and when was the last time you used some canned air to blow the dust out of it?|
If you can locate the sound to be coming from the power supply (which is what I suspect) then replace it.
The squeeling could be coming from your hard drive do to a bearing wearing out. If the sound is coming from your hard drive then you will want to replace it. (I am guessing not because this does not normally shut your computer down just causes it to freeze.