我知道存在关于同一问题的多个问题,但在遵循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