我正在尝试使用AVAudioPlayer
播放mp3文件:
NSString *path = NSString stringWithFormat:@"%@/%@" ,
[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
NSURL* url = [NSURL fileURLWithPath:path];
AVAudioPlayer* player = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil];
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: nil];
[player play];
NSLog(@"%f/%f", player.currentTime, player.duration);
然而,即使玩家的持续时间为1044.437506,玩家每次都会停在478.558367附近。 为什么玩家会停在赛道中间?