Tôi biết nhiều câu hỏi liên quan đến cùng một vấn đề tồn tại, nhưng sau khi làm theo các đề xuất this one's, tôi đã gặp phải một số vấn đề.Làm cách nào để lặp lại hàng đợi âm thanh trong AVQueuePlayer?
Tôi đã thiết lập mọi thứ nhưng tôi gặp lỗi mach mỗi khi tôi sử dụng kMTTimeZero.
soundQueue = [AVQueuePlayer queuePlayerWithItems:soundEmotions];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playerItemDidReachEnd:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:[soundEmotions lastObject]];
Đây là những gì tôi đã làm.
- (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)
Cảm ơn bạn! Tôi đã thêm vào khung công tác và nó xây dựng tốt, nhưng vì một lý do nào đó nó vẫn không lặp lại âm thanh. Tôi có làm đúng không? Cảm ơn! – KingPolygon
Tôi đã tìm ra! Cảm ơn bạn mặc dù! – KingPolygon
@KingPolygon, bạn đã làm gì để tạo vòng lặp AVQueuePlayer? – Raphael