A humming or buzzing compressor is telling you that something is wrong with the power on the compressor. It could be a power supply issue, or a problem in the delivery of power to the compressor motor throught the various electrical devices on the compressor.
A 120 VAC household circuit, with a 20 amp breaker, cannot provide enough power for a compressor motor exceeding 1 HP in size to start properly. However, most DIY air compressor owners are powering their air compressors with a 120 volt circuit.
In order to make up the shortfall in the power neeeded to get an electric compressor motor running, the motor will have a start capacitor. Some have a start / run capacitor, with the run capacitor providing a power boost to help when the compressor motor is trying to run under load, like when the air tank is filling up, for example.
How do you check? First find the capacitor or capacitors on your compressor motor.
Look at the electric motor. You may have to remove some shrouding or shielding. Your air compressor motor will likely have one or two tubular bumps at the shaft end, likely attached to the outside of the motor housing. One of these bumps contains the start capacitor, and if there are two, the other contains the run capacitor.
Once you have found the capacitor, then see the page on this site under troubleshooting for information on how to check a start and run capacitor.