react-native-sound
react-native-sound copied to clipboard
Calling .stop( ( ) => { .play( ) } ) doesn't work when sound is playing
Hi !
I want to play a sound with a button. If the sound is already playing I also want the button to work, stopping, rewinding and playing again the sound, but it doesn't seem to work. Here is my function.
export function PlaySound(audioRef){
audioRef.stop(()=>{
audioRef.play((success)=>{if(success)console.log('sound played !')})
})
}
}
It plays the sound, and plays it again when I press again after the sound has finished. But If I press while the sound is playing, no sound is played, and the console stille shows 'sound played !' Why is that ? Any solution ?
Have the same problem
Is there any update on this issue? Still facing this