NSString *audioPath =[[NSBundle mainBundle]pathForResource:@"aaa" ofType:@"m4a"]; NSURL *url = [NSURL fileURLWithPath:audioPath]; NSError *error; audioPlayer = [[AVAudioPlayer alloc]initWithContentsOfURL:url error:&error]; audioPlayer.numberOfLoops = 1; [audioPlayer play]; NSString *audioPath =[[NSBundle mainBundle]pathForResource:@"aaa" ofType:@"m4a"]; NSURL *url = [NSURL fileURLWithPath:audioPath]; NSError *error; audioPlayer = [[AVAudioPlayer alloc]initWithContentsOfURL:url error:&error]; audioPlayer.numberOfLoops = 1; [audioPlayer play];