This is yet another reason why I like dogs.
Once you know a particular dog, you get a pretty good idea of the differences in the sounds it will make, for instance, "Oh boy!!! Somebody is here!!!" vs, "Somebody is here whom I do not trust!!! Alert!!! Danger!!!"
My dogs will let me know if a friend shows up. They will also let me know if a stranger shows up. The sounds are not the same.
The added benefit is that medium large, snarling dogs often discourage people from trying to enter the wrong house.
On another note, having a safe place (concealment, cover) from which one can observe entry points can help afford enough time to identify friend from foe. The more secure the house, the more luxury of time afforded. But I would still call 911, until absolutely sure it is not foe.
My dog is excellent with this. she always alerts me someone or something is coming. There is a small list of people who tend to elicit a happy golden retriever response. The rest get a growl, woof, snarl, and finally hide behind Dad approach.
The very nice thing about this is that I get the happy golden response which lets Mrs. Vermonter know instantly that it is me coming home.