avaudioplayer playingsong

拜拜、爱过 提交于 2019-12-11 04:50:07

问题


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.


回答1:


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];



来源:https://stackoverflow.com/questions/5271332/avaudioplayer-playingsong

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!