To discover whether an AVAudioPlayer
object is playing, I can simply use the isPlaying
property:
if audioPlayer.isPlaying {
// ...
}
If the audio player is not playing however, how can I distinguish between it being paused and it being stopped?
I can't use the currentTime
property for this purpose. This is because if I call stop()
, then the current time stays at whatever time it was at the time of the call, which is the same behaviour as when pause()
is called.