1

I created instance AVAudioPlayer but the instance is working only once like if I give

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

for 1st time its giving i=1 while playing and other times its giving i=2 while playing.

Viraj
  • 1,880
  • 22
  • 31
user2032200
  • 99
  • 1
  • 8

1 Answers1

0

AVAudioPlayer reference Reference clearly mentions this about the playing property

Important: Do not poll this property (that is, do not use it inside of a loop) in an attempt to discover when playback has stopped. Perhaps u can try [audioPlayer isPlaying];

visakh7
  • 26,380
  • 8
  • 55
  • 69