Well, humming is made by the production of voice sounds. Door bell chime is automatically generated. I am not really sure what you are asking here. But these two sounds can be intertwined with any computer programming. Now a days you can virtually make any sound that is required to be made.
The problem normally lies within the Doorbell Button itself, replacing the transformer alone will not do the trick. Go to a reputable DIY store and you will be able to buy yourself a cheap button to replace the old one with.!!
What most likley can be causing a humming in a doorbell chime is a short in the circuit. This could be caused by two exposed wires that are touching each other or a defect in the device itself. This problem can happen to many devices and it not restrictive to doorbells.
If you have a wireless doorbell than you may want to check the batteries. If it is hardwired it could be some failing electronics, try replacing the outdoor fixture first, just don't shock yourself. Turn off the breaker.
Depending on how your doorbell-chime is designed/manufactured:
"Humming" can be caused by a "mechanically-loose" transformer;
or by "electrical-noise" caused by improper-grounding/lack-of-sufficient-electrical-shielding/component-failure(s) in an audio-amplifier circuit.
There are two common reasons for a doorbell to be humming. A button could be stuck in the on position or some wires may be shorted together somewhere within the run between the doorbell and the buttons.