1
因此,我正在完成一個iPhone應用程序。Objective-C/iPhone中的音頻循環
我已經制定了下面的代碼來播放該文件:
while(![player isPlaying]) {
totalSoundDuration = soundDuration + 0.5; //Gives a half second break between sounds
sleep(totalSoundDuration); //Don't play next sound until the previous sound has finished
[player play]; //Play sound
NSLog(@" \n Sound Finished Playing \n"); //Output to console
}
出於某種原因,聲音播放一次,然後代碼迴路,它輸出以下內容:
Sound Finished Playing
Sound Finished Playing
Sound Finished Playing
etc...
這只是我永遠不會重複,我想你們中任何一個可愛的人都無法理解這可能是什麼?
乾杯!
你的意思是這樣的: - (無效)audioPlayerDidFinishPlaying:(的NSString *)audioPlayer完成:(BOOL *)完成背景:(無效*)上下文{} - 你可以彈出了我一個簡單的例子任何機會,請? :) – 2010-03-19 10:02:57
當然,給我第二個... – 2010-03-19 10:09:01
非常感謝! – 2010-03-19 10:41:45