1

In my android application I only play a looping sound with MediaPlayer. I'm trying to loop fluid, eliminating the time between the end of the track and the beginning of the next reading. I tried with the function setLooping but there is a time between sounds. I tried with setOnCompletionListener function like this:

MP.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
    @Override
    public void onCompletion(MediaPlayer mp) {
        MP.start();     
    }
});

However, there are still a few seconds between sounds.

Tiago Almeida
  • 14,081
  • 3
  • 67
  • 82
DevPunk
  • 11
  • 1

1 Answers1

0

Apparently it is not possible with MediaPlayer; there's an open bug asking for gapless playback that has been open since 2009.

Android: MediaPlayer gapless or seamless Video Playing also has several non-answers on the topic.

Community
  • 1
  • 1
nneonneo
  • 171,345
  • 36
  • 312
  • 383
  • is there any solution using an another class ? – DevPunk Sep 29 '12 at 18:26
  • I don't have any ICS devices on hand, but *supposedly* `MediaPlayer` in ICS 4.0 works. Otherwise, you will have to find a third-party component since the base Android classes won't do it. – nneonneo Sep 29 '12 at 18:33