Avaudioplayer playingsong

I created an AVAudioPlayer instance, but the instance only works once, as if I gave

 if(a.playing) { i=1 } else { i=2 } 

the first time it gives i=1 during playback, and in other cases gives i=2 during playback.

+1
source share
1 answer

The AVAudioPlayer Reference clearly describes this property of the game.

Important: do not try this property (that is, do not use it inside the loop), trying to detect when playback is stopped. Perhaps you can try [audioPlayer isPlaying];

0
source

All Articles