I had this same problem when setting currentTime
before invoking the play method. Moving the property set of currentTime
to after invoking play method allowed AVAudioPlayer
to return YES
instead of NO
. I'm not sure why this is, hope it helps.
Edit: after further consultation with this issue, calling stop then play seems to work more consistently and thus allows currentTime
setting before the play method. You may want to call prepareToPlay
just after your stop though to queue it up again for play when you're ready to resume.