Elephants are able to work out ethnicity, gender and age from the sound of a human voice, according to a study.