Yêu cầu Aug 18th, 2017 4:28 a.m. 2000 0 1
  • 2000 0 1
0

[Android] Remove gap between loops on media player

Chia sẻ
  • 2000 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 CÂU TRẢ LỜI


Đã trả lời Aug 18th, 2017 6:51 a.m.
Chia sẻ
Avatar Khanh Nguyen @khanh.nguyen.viet
Aug 18th, 2017 6:59 a.m.

I have tried but the bug still occur. Thank you

Aug 18th, 2017 7:18 a.m.

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.

Avatar Khanh Nguyen @khanh.nguyen.viet
Aug 18th, 2017 9:41 a.m.

Thank @licon but i got same result too

Viblo
Hãy đăng ký một tài khoản Viblo để nhận được nhiều bài viết thú vị hơn.
Đăng kí