We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm putting together an application which plays a series of sound files in sequence; I want to be able to tell when a file has finished.
The obvious ways of doing this (checking for the currentTime() >= duration() and checking for !.isPlaying() && !.isPaused()) don't work - when a sound file finishes playing, currentTime() returns 0, and the second statement is also true when there's nothing playing at all.
I can probably sort this by tracking the currentTime and watching for a jump down from a non-zero value, but this seems like a hacky way of doing things. Have I missed something obvious or is there a feature that isn't documented that would solve my problem?
Relatedly, it seems like it would be useful for the soundFile to raise some sort of event when it finishes playing, or alternatively for its currentTime to remain equal to its duration rather than resetting to zero.