音乐播放
//包含音频播放器,录音 #import <AVFoundation/AVFoundation.h> NSString *path=[[NSBundle mainBundle]pathForResource:@"爸爸去哪儿" ofType:@"mp3"]; //实例化对象,指定要播放的音频文件 _audioPlayer=[[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:path] error:nil]; //设置代理 _audioPlayer.delegate=self; //准备播放 [_audioPlayer prepareToPlay]; //开始播放 [_audioPlayer play]; //获取该音频文件的总时长(秒) NSTimeInterval len= _audioPlayer.duration; //获取当前播放的时间点(也可以设置) NSTimeInterval ct= _audioPlayer.currentTime; //音量 float v= _audioPlayer.volume; <AVAudioPlayerDelegate> //当音频文件正常播放结束后执行 -(void)audioPlayerDidFinishPlaying:(AVAudioPlayer *