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.