我正在尝试同时播放多种声音。
我最初采取的方法是创建多个玩家,但这似乎是错误的。
同时播放多个音频文件的最佳方式是什么。
是否通过将它们制作为 AVAssets,但在这种情况下,我如何随时停止并播放它们。
非常感谢您的帮助。
我需要 AVPlayer 的原因是从 iPod 库中获取声音。
我终于从 Apple Dev Team 的 TechSupport 得到了答复,当我决定使用多个 AVPlayer 时,看来我走上了正确的道路。
最佳答案
对于您想要制作的每种声音,制作一个新的 AVPlayer。
NSURL *url = [NSURL URLWithString:pathToYourFile];
AVPlayer *audioPlayer = [[AVPlayer alloc] initWithURL:url];
[audioPlayer播放];
关于xcode - 使用 AVPlayer 播放多个音频文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6193844/