react-native-sound icon indicating copy to clipboard operation
react-native-sound copied to clipboard

Audio after playing not stopped

Open iasreact1 opened this issue 2 years ago • 0 comments

Hello, I have added audio in my cache directory and then played it creating a sound object with in a function like that const playAudio = () => { if (selectAudio) { const sound = new Sound(selectAudio, Sound.CACHES, (error) => { if (error) { console.log('Error loading audio file', error); return; } setSound(sound); sound.play(); }); } }; But now i have to stop the audio after certain time using sound.stop() from another function and it will not worked and even not call i think sound object not properly passed please help if i want to stop the sound from another function..please help

iasreact1 avatar Mar 15 '23 14:03 iasreact1