我正在寻找一些解决方案,等待 SuperpoweredAdvancedAudioPlayer 打开文件。我制作了 ios objective-c 应用程序,我想同时播放多个曲目。但是当我尝试以这种方式开始曲目时:
player1->open([[[NSBundle mainBundle] pathForResource:[[tracksNamesBigArray objectAtIndex:row] objectAtIndex:0]ofType:@"mp3"] fileSystemRepresentation]);
player1->play(true);
player2->open([[[NSBundle mainBundle] pathForResource:[[tracksNamesBigArray objectAtIndex:row] objectAtIndex:1] ofType:@"mp3"] fileSystemRepresentation]);
player2->play(true);
player3->open([[[NSBundle mainBundle] pathForResource:[[tracksNamesBigArray objectAtIndex:row] objectAtIndex:2] ofType:@"mp3"] fileSystemRepresentation]);
player3->play(true);
player4->open([[[NSBundle mainBundle] pathForResource:[[tracksNamesBigArray objectAtIndex:row] objectAtIndex:3] ofType:@"mp3"] fileSystemRepresentation]);
player4->play(true);
或者当我将其包装在函数中并制作如下内容时:
[self openPlayers:row]
[self playAll];
它不会同时完美地开始播放,最后一首或 2 首曲目以 0.5s-.8s 延迟开始(在第一个示例中延迟大于秒)。如何等到打开成功再开始玩?我在超级强大的文档中没有找到任何功能。