Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android repeatedly play a mp3 file without any gap

I want to play a mp3 file from sdcard repeatedly without any gap. I am using MediaPlayer.setlooping(true) method to repeatedly play the mp3. it works fine. But it gives a gape of few seconds between repetition. I also looking for soundPools but it also give some gap. So is there any class, method or some idea that help me to eliminate the gap of few seconds.

like image 702
mnsalim Avatar asked Mar 05 '14 11:03

mnsalim


1 Answers

After doing some handy experiments at last i got my solution using

mPlayer.setLooping(true);

mPlayer is an instance of MediaPlayer class. Although this line of code looping the code but this have a few gap between consecutive sounds. However finally it works for me. Any one can give a try to MediaPlayer class. its really awesome for handling audio file.

like image 192
mnsalim Avatar answered Oct 30 '22 00:10

mnsalim