Doug-dev
Doug-dev

Reputation: 27

Playing background sound loop

So I am developing a game and I want it to have background sound and sound in reaction to touch events. But taking it one step at a time I would really like to know how to play my mp3 in the background of my game?

Upvotes: 1

Views: 766

Answers (1)

DRiFTy
DRiFTy

Reputation: 11369

You will either want to use MediaPlayer or SoundPool or both! With MediaPlayer you will want to use it for longer sounds such as background music that is played throughout your game. SoundPool is used more for things such as sound effects (shorter sounds that are played when something in your game occurs). There are many examples in the Android documentation on how to use both of these.

Upvotes: 3

Related Questions