zmxv / react-native-sound

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

setNumberOfLoops() not working properly #792

Open yash15601 opened 2 years ago

yash15601 commented 2 years ago

:beetle: Description

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

:beetle: Please post your code:

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()

:bulb: Possible solution

Is your issue with...

Are you using...

Which versions are you using?

Does the problem occur on...

If your problem is happening on a device, which device?