Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The Music Player Controller is designed as a “hands-off” approach to handling the audio session of an iOS device. When using the music player controller, you really don’t have to worry about the audio session because all interactions are handled through the system iPod session.
You may have noticed, however, that the MPMusicPlayerController is designed to work specifically with media sources in the iPod music library. So if you’re playing background music in your game or a sound effect in your app, you can’t use this player because those items do not exist in the music library.
In the cases where you want to play audio from sources located in your application sandbox (either in the app bundle like a sound effect, or a downloaded resource in the Caches directory), you will need to use an AV Foundation-based player, AVAudioPlayer. Additionally, because you’re not using the system iPod audio session, you’ll need to define the audio session yourself and set up the requirements and behaviors of that session based on the needs of your app.