我知道存在關於同一問題的多個問題,但在遵循this one's建議之後,我遇到了一些問題。如何循環播放AVQueuePlayer中的聲音隊列?
我已經設置了一切,但每次使用kMTTimeZero時都會遇到mach錯誤。
soundQueue = [AVQueuePlayer queuePlayerWithItems:soundEmotions];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playerItemDidReachEnd:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:[soundEmotions lastObject]];
這就是我所做的。
- (void)playerItemDidReachEnd:(NSNotification *)notification {
// Do stuff here
NSLog(@"End has been reached.");
// Set it back to the beginning
[soundQueue seekToTime:kCMTimeZero];
//Replay
[soundQueue play];
}
ERROR: Undefined symbols for architecture armv7: "_kCMTimeZero", referenced from: -[ViewController playerItemDidReachEnd:] in ViewController.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)
謝謝!我添加了框架,它構建得很好,但由於某種原因,它仍然沒有循環播放聲音。我沒有做對嗎?謝謝! – KingPolygon 2013-03-11 19:30:05
我想通了!謝謝你! – KingPolygon 2013-03-11 19:52:08
@KingPolygon,你做了什麼使AVQueuePlayer循環? – Raphael 2014-11-18 15:21:23