Natively, AndEngine offers a SoundPool
implementation to store all the sound samples that we load. This pool is wrapped by a SoundManager
class and offers a Sound
class that can be used as reference to a particular sample within the pool.
Related to this are the Music
class and its MusicManager
and MusicFactory
classes. While seemingly similar to the Sound
class and the related classes, the Music
class doesn't use a SoundPool
, with each Music
instance wrapping around a standard Android MediaPlayer
instance instead. This makes it suitable for something like a background music track, but little more. It's also a lot more resource-heavy due to this implementation, so use the Sound
class and its SoundManager
class for short samples, such as effects. MusicManager
, however, is very suitable for long background tracks, since the MediaPlayer
instance that it uses is capable of streaming the track from the storage, lowering memory requirements. The following screenshot shows...