Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between AVAudioPlayer and MPMusicPlayerController?

Tags:

iphone

It looks like both of them can play audio file. What is the difference between AVAudioPlayer and MPMusicPlayerController?

Welcome any comment

Thanks interdev

like image 247
arachide Avatar asked Aug 11 '10 05:08

arachide


1 Answers

Read the class reference

MPMusicPlayerController: http://developer.apple.com/iphone/library/documentation/mediaplayer/reference/MPMusicPlayerController_ClassReference/Reference/Reference.html

You use an MPMusicPlayerController object, or music player, to play media items from the iPod library.

AVAudioPlayer: http://developer.apple.com/iphone/library/documentation/AVFoundation/Reference/AVAudioPlayerClassReference/Reference/Reference.html

An instance of the AVAudioPlayer class, called an audio player, provides playback of audio data from a file or memory.

Apple recommends that you use this class for audio playback unless you are playing audio captured from a network stream or require very low I/O latency.

like image 84
iwasrobbed Avatar answered Nov 12 '22 21:11

iwasrobbed