0

I want to make a application in which i play the .mp3 file i play the sound by selecting it from raw or asset folder which is hard coded in code. But i want that user pick any mp3 file anywhere from their android phone and make play it

Can any one help me

Thanks in advance

user3765485
  • 69
  • 2
  • 9

1 Answers1

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

mediaPlayer.start();
int duration = mediaPlayer.getDuration();
int current_position = mediaPlayer.getCurrentPosition();

mediaPlayer.pause();

Great tutorial on Media Playback through MediaPlayer:

http://www.tutorialspoint.com/android/android_mediaplayer.htm

Georgi Angelov
  • 4,338
  • 12
  • 67
  • 96