Asked Aug 18th, 2017 4:28 AM 1039 0 1
  • 1039 0 1
0

[Android] Remove gap between loops on media player

Share
  • 1039 0 1

I use MediaPlayer to playing loop background sounds in our apps. The file is .ogg audio format.

MediaPlayer mp1 = MediaPlayer.create(context, R.raw.track1); mp1.setLooping(true); // setting loop mp1.start();

I notice there is a gap when the audio file loops. How to remove the gap when the audio file replays again? Thank you.

1 ANSWERS


Answered Aug 18th, 2017 6:51 AM
Share
Khanh Nguyen @khanh.nguyen.viet
Aug 18th, 2017 6:59 AM

I have tried but the bug still occur. Thank you

0
| Reply
Share
Aug 18th, 2017 7:18 AM

This bug is device specific. Maybe your solution is successful in some devices & also failed in other devices. Can you please see this url: https://stackoverflow.com/questions/21247670/android-mediaplayer-loop-has-gaps-even-with-ogg-format which has one answer.

0
| Reply
Share
Khanh Nguyen @khanh.nguyen.viet
Aug 18th, 2017 9:41 AM

Thank @licon but i got same result too

0
| Reply
Share