SoundPool is actually an audio mixer.
It can play short clips only, regardless of whether they are encoded as “ogg” or “mp3” or they are uncompressed. SoundPool always store them in memory uncompressed, and note that the limit is 1 MB. If your clip is too big in memory, SoundPool will fall silent and you’ll get the following error: “AudioFlinger could not create track. status: -12”
MediaPlayer plays stream and decode it in real time.
It can play much longer clips but it needs processor power for it.
Conclusion:
SoundPool:
= is better fort short audio effects (clicks, explosions, sound loops).
= can play more clips simultaneously, and has volume and speed control. It can also play loops.
MediaPlayer
= is better for background music
= cannot play the same sound clip when it is already being played. It needs the clip to be completely finished before it could be played again.
Note:
You can’t play music from SoundPool if the clip isn’t fully loaded and decoded. So you must use OnLoadCompleteListener (Android 10 or above) to check for it. If you try to play a sound before it’s decoded, SoundPool will be mute. MediaPlayer doesn’t suffer from these problems.