Open jordangrant opened 1 year ago
hi @jordangrant I think our issues are similar am trying to stop the current song when the user is leaving the screen.
which am doing inside a useEffect. but it not working.
did you find a solution around yours ?
@tdammy92 no solution with this library, simply using react-native-video with invisible views, and mp3, mp4 and m4a files works absolutely perfectly and great settings to control it too.
@jordangrant, Add the audio as part of the dependency. it should work
useEffect(() => { playSound(battle?.animation) }, [battle?.animation,audio]);
This will help https://www.youtube.com/watch?v=vVI7ZAZq5e0
Appreciate the work done here but ran into many issues playing sound effects while listening with useEffect ala:
and with .aac files crashing https://github.com/zmxv/react-native-sound/issues/802
and with the error "playback failed due to audio decoding errors"
tried useRef to no avail https://github.com/zmxv/react-native-sound/issues/728#issuecomment-901830211
and different syntax, moved things around, you get the idea. tested on iOS device.
Had quicker and easier success with react-native-video: https://github.com/react-native-video/react-native-video
Thanks for the good times though