zmxv / react-native-sound

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

Any way to repeat the sound till x specified time? #697

Open NSR88 opened 4 years ago

NSR88 commented 4 years ago

Hello,

I have a requirement of playing a sound, and to repeat it till given time, say 5 minutes. If the actual file is 3 minutes (180 seconds) long, then it should play (at least for given time, 5 minutes in this case) for 3 minutes + 1 sec pause + 3 minutes (that is, 361 seconds) . But, it shouldn't remain incomplete, that is, the cycle should be completed.

if the audio is bigger than given 5 minutes, then it should be played one full cycle.

As, I also need to show seekbar according to the combined cycles. I am looking if anything possible with a single sound object, instead of multiple sound instances, or to loop it again and again.

Any suggestion on the same?