I'm very frustrated at this point. I've been reading the expo documentation and online answers as well but nothing is helping.
Honestly would pay money at this point for a solution...
my issue is that no matter what I try, I just can't seem to play the next audio clip after my current audio file has finished playing.
I know there is an example of a playlist out there on github, but its so old and has hundreds of lines of code and is running into issues without even changing anything.
For all its worth, I'll copy and paste my current code in here in hopes I can get some help. Would be extremely appreciated.
const [listView, setListView] = useState(true);
const [ayahData, setAyahData] = useState([]);
const [sound, setSound] = useState(null);
const [number, setNumber] = useState(null);
useEffect(() => {
return sound
? () => {
sound.unloadAsync();
}
: undefined;
}, [sound]);
async function playSound(soundURL) {
const { sound } = await Audio.Sound.createAsync({
uri: soundURL,
});
setSound(sound);
await sound.playAsync();
}
The code above works if I click on a specific audio, but obviously in its current state wont automatically move to the next.
Small hints like how to properly listen for an audio ending with my current block of code would be more than enough.