My ear is not good enough to determine the key of a piece of music just by hearing.
Is there a way to automatically determine the key and tempo of a musical recording using a computer?
There are a few resources which may be of help:
If you want to work it out from a local file you can always use a DJ beat-matching app like Djay Pro to give you the BPM and key. Results may vary.
What I do is take a tuner to see what the last chord is. That is usually the key it is in. (Occasionally, a song in C major will end on a D or an even stranger note, so in that event you'll have to see what other notes are in the song.) And for the tempo, use a tap metronome and keep tapping every beat. Most pop, rock, and hip hop songs are 80-160 BPM. if you get something like 204, it's probably 102. I mainly listen to Contemporary Christian Music, which (it seems like, anyway) 60% of the songs are in C major (probably because hymns were mostly written it that key), so I can usually tell when a song in C major is on even on TV commercials, et cetera.