Reputation: 1447
Can anybody explain me what's the difference between AudioManager
and MediaPlayer
in Android ? If I am correct, then AudioManager
can only play audio, while MediaPlayer
can play both audio and video. But I believe there must be more to this.
Thanks.
Upvotes: 6
Views: 3867
Reputation: 1837
AudioManager is used to manage audio settings. This includes volume control and the streaming channels (e.g. ringer, media, in-call, etc.).
MediaPlayer is used for controlling the playback (e.g. stop, play, pause, etc.) of audio/video streams.
Upvotes: 4
Reputation: 22342
AudioManager doesn't play sound at all. It provides access to sound settings, but to play sounds easily, you should use MediaPlayer, SoundPool, or possibly AudioTrack.
AudioManager provides access to volume and ringer mode control.
Upvotes: 6