Dynamic theory of sound-source localization