React-native-sound setNumberofLoops not working

Viewed 44

I'm using react-native-sound package to play sound 10 times at a time in a loop but setNumberOfLoops(10) or any positive number in it does not work, it start playing 30-40 times

And how can I convert callback to promise so that I can try other way to play sound multiple times, since the current implementation is in callback for play() method (simply how can I use await with it)

export let xSound = new Sound("x.wav", Sound.MAIN_BUNDLE, (error) => {
  if (error) {
    console.log("Sound Not Loaded successfully");
    return;
  }
});

xSound.setNumberofLoops(10)
xSound.play()

Any alternatives for react-native-sound? I'm using bare workflow for my react-app

Thanks in Advance ✨

0 Answers
Related