Madan Mohan
Madan Mohan

Reputation: 8810

What is the diff between AVAudioPlayer vs MPMusicPlayerController

which one is better and what is the difference between them, AVAudioPlayer or MPMusicPlayerController.

Please share your ideas. Thank you, Madan Mohan.

Upvotes: 1

Views: 1911

Answers (2)

NightFury
NightFury

Reputation: 13546

AVAudioPlayer is able to play one song at a time. It cannot access iPod Library means you cannot play songs which are present in user's iPod's Library. But biggest advantage I see is AVAudioPlayer can play songs when your app is in background.

MPMusicPlayerController is used to play songs from a playlist you pick using MPMediaPickerController from iPod Library which is a plus point. It accesses many properties of song which AVAudioPlayer cannot. It cannot play music in background.

Upvotes: 1

Gavy
Gavy

Reputation: 1949

AVAudioPlayer is more lightweight and suited for playing single songs at a time

MPMusicPlayerController requires more resources because it has more features and is designed to play playlists containing several songs

Upvotes: 0

Related Questions