Yêu cầu thg 8 18, 2017 4:28 SA 2014 0 1
  • 2014 0 1
0

[Android] Remove gap between loops on media player

Chia sẻ
  • 2014 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 thg 8 18, 2017 6:51 SA
Chia sẻ
Avatar Khanh Nguyen @khanh.nguyen.viet
thg 8 18, 2017 6:59 SA

I have tried but the bug still occur. Thank you

thg 8 18, 2017 7:18 SA

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
thg 8 18, 2017 9:41 SA

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í