Closed kg-currenxie closed 3 years ago
// Play the sound with an onEnd callback whoosh.play((success) => { if (success) { console.log('successfully finished playing'); this.nextSong(); } else { console.log('playback failed due to audio decoding errors'); } }); });
I misread the docs :) Thanks
:clipboard: Description
Get a callback when playback has reached the end.
:microphone: Motivation
I have several clips that I would like to play in a sequence. I have to know when a sound has finished playing so I can start the next one.
:bulb: Alternatives
SetInterval and checking currentTime, comparing to the total length 🤦 Not good.