Water heater troubleshooting is as matter of finding the problem by eliminating possible problems. If you are hearing a high-pitched sound then check out these possible solutions.
Step 1 - Check the Pressure Relief Valve
Check this emergency relief valve. If it is hot to the touch this may be the source of the sound. Try lowering the temperature.
Step 2 - Test the Thermostat
Run some hot tap water into a bucket and check the temperature. See if it matches the thermostat setting. If it is more than a few degrees off you may need to replace the thermostat.
Step 3 - Eliminate Scale Buildup
Particularly if you have hard water you may have a buildup of scale on the heating elements. You can flush the tank and clean the heating elements to fix this problem. You may want to soften your water or treat it chemically for scale buildup in the future.
Step 4 - Flush the Tank
Sediment may accumulate in the bottom of the tank. To flush the tank hook up the garden hose and drain the tank. Be sure to shut off the cold water inlet and open the pressure relief valve before draining. Reverse this once the water heater tank is drained.
One of these steps is likely to do away with that whine in your hot water heater. Now you can really enjoy your shower.