react-native-audio-toolkit
react-native-audio-toolkit copied to clipboard
[Android] Gaps between loops
Hey! I've tried using .mp3 and .ogg file types but the player is still looping with gaps. Is there any workaround?
@kyrylenko the same thing happens to me, did you solve it somehow?
Any update on this issue ?
Can't believe this issue still exists 🙄 I'm experiencing the same for iOS.
Facing the same issue. It ruins the user experience.
I overcame the issue with below custom loop:
- Note the exact duration of each of your sounds in milliseconds.
- Create a
setIntervalmethod and pass the millisecond of your sounds. - Inside
setInterval, call the methodplayer.seek(0)to play from the beginning. - Whenever you want to stop the player, simply
clearInterval(selectedSound.interval).
Code:
selectedSound.interval = BackgroundTimer.setInterval(() => {
selectedSound.player && selectedSound.player.seek(0)
}, selectedSound.duration);
This is not an ideal solution and it does have a tiny gap from time to time but it is much better than the gap in the looping provided in the library.