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.
Asked
Active
Viewed 1,553 times
6
-
might also be duplicate My background loop music doesn't “loop” good – Martin Frank Mar 05 '14 at 12:07
2 Answers
2
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.

mnsalim
- 947
- 6
- 16
0
I think thats not possible, but you can try to implement fade-in and fade-out methods. Check this link:
How to create fade-in/fade-out sound effects for any music file that my app plays?
EDIT: Or try this, i guess this should work: https://stackoverflow.com/a/13410499/3377857

Community
- 1
- 1

Klemens Morbe
- 595
- 9
- 24
-
I appreciate you answer. But i didn't want to fade in-out my sound. I just want to eliminate the gap between repetition. I will try to do this if i did't get any kinds of solution. Thanks. – mnsalim Mar 05 '14 at 12:14
-
thanks Morbe for your answer, its really a well resource but i have to use mp3 file, i could not use .ogg file format. – mnsalim May 05 '14 at 15:17