Processing of natural stimuli in sensory systems has been traditionally studied within two theoretical frameworks: probabilistic inference and efficient coding. Probabilistic inference specifies optimal strategies for learning about relevant properties of the environment from local and ambiguous sensory signals. Efficient coding provides a normative approach to study encoding of natural stimuli in resource-constrained sensory systems. By emphasizing different aspects of information processing they provide complementary approaches to study sensory computations. Here, I will discuss application of these two frameworks to study behavioral and neural aspects of auditory scene analysis in natural environments. Through the talk I will discuss similarities and differences between these two approaches and conclude by proposing a unifying perspective on probabilistic inference and efficient coding in sensory systems.