7

I am playing a setLooped enabled audio file in my app, but every time the audio file loops, there is a noticeable, though very brief, gap in the audio playback... is there any way to get around this?

Frank Bozzo
  • 243
  • 1
  • 2
  • 6
  • 1
    Is this problem really insoluble!? I've came to MediaPlayer because SoundPool doesn't play long audio files and now MediaPlayer is terrible at looping audio! – SARose Jan 14 '15 at 04:36

2 Answers2

1

I was just facing the same problem and I guess you have been using MP3 or OGG files or some other compressed format. The solution is to use WAV files instead. This may increase your apk size but lets you loop gapless.

Vincent
  • 27
  • 6
0

I had the same problem and did try to switch from MP3 to WAV. Then looping worked gaplessly in emulator, but not in my phone. Using OGG files actually made it work in phone too. So using .ogg could be worth a shot too, but I don't actually underst

Arttu
  • 983
  • 8
  • 12
  • 2
    Same problem. I've tried every format, and now I am reading that the only way to get gapless loops is to use the SoundPool() class with files under 1mb!? This is just insane. So I guess I will try that. Why is Android audio so buggy at 4.0x is besides me. – John Drefahl Aug 31 '12 at 18:48
  • Also, it has to be at max 5 seconds long – Mladen Rakonjac Aug 23 '16 at 13:01