Resonance theory of acoustic reflection and transmission through a fluid layer