zmxv / react-native-sound

React Native module for playing sound clips
MIT License
2.79k stars 749 forks source link

The audio looping is not gapless #361

Open ghost opened 6 years ago

ghost commented 6 years ago

there's a little gap when looping the audio, which is not desirable for playing,say,a small ambiance audio clip. What is the best possible method to achieve seamless audio looping ?

zsaraf commented 6 years ago

+1

zsaraf commented 6 years ago

Only an issue an issue on Android! Any thoughts here?

franzwarning commented 6 years ago

+1

kyrylenko commented 6 years ago

There are gaps between loops because of the bug in Android MediaPlayer (which is used under the hood). To fix the problem I've created the react-native-audio-exoplayer module, which has pretty same functionality as the react-native-sound, but it is based on the Android ExoPlayer. The API is a bit different but more robust and modern (have a look at the docs). Later if I have time I'll do a pull request to introduce ExoPlayer in the react-native-sound. But for now feel free to use react-native-audio-exoplayer as a good workaround (for now it's implemented only for Android).