It might be easier with talking because the natural pitch of your voice is more-or-less constant. If it’s not constant from day-to-day, it may not be the pitch, but the tembre (the harmonics & overtones that make different people sound different, even when the pitch matches). If you have a cold, the pitch of your voice may change. If you’re under stress, the pitch and/or tembre may change, etc.
With humming, there’s a good chance you’re hitting pitches in-between notes (especially if you are not a trained singer/musician) and although you can pitch-shift to get some notes on-pitch, other notes will be off-pitch.
If you are a trained singer/musician, or if you just have a “good ear”, the relative pitch between notes may be OK, and you can pitch-shift to make all all of the notes correct. If you are very lucky and you have perfect-pitch, you can sing/hum the exact notes without a reference or backing music as a reference.
There are applications such as AutoTune or Melodyne (and some free ones) designed to make note-by-note corrections. They can automatically pick the closest actual note (in the selected scale) or the notes can be corrected one at a time, manually or with a MIDI reference.
Pitch refers to the perceived frequency of a particular note. All real-world sounds are composed of many frequencies, and the pitch is usually determined by the lowest, or dominant frequency-component. A note has a pitch. A song doesn’t have a single pitch. A song has a key, which is (usually) the dominant or starting-note (or chord) in the song.
There are 12 notes in an octave (in American/European music) but most music is written in a particular scale, which is a subset of the “available” notes. And, some instruments can’t play all 12 notes.
The A = 440Hz standard is a tuning-standard. So, an A on one instrument matches an A on another instrument (and all of the other notes match too). That doesn’t mean the song has to be composed or performed in the key of A. 220Hz is also an A, one octave down, and 880Hz is an A, one octave up.