Play a series of audios on android

Asked

Viewed 35 times

0

Good evening, has anyone done or knows how to play a series of audios ? I am trying to make an app similar to that game Genius. And I would like to be able to play a sequence of audios that I will pre-determine. I wish I could do it inside a loop, only it only plays the last audio. Does anyone have any tips or can tell me how to do this ?

1 answer

0

First you should put your audio files in the folder raw of your project, done this using the object MediaPlayer simply initialize the object for use. Example:

Creating

MediaPlayer mediaPlayer = MediaPlayer.create(this, R.raw.song);

Using

mediaPlayer.start();
mediaPlayer.pause();

More options

  • Dude, it doesn’t work. I was doing it like this. For example if I do one it just plays the last file.

  • Post your code here, then it’s easier!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.