@property(nonatomic,strong)AVAudioPlayer *movePlayer ;
2、初始化变量并播放:
NSString *tmp=[[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"a.mp3"];
//NSString * tmp = [[NSBundle mainBundle] pathForResource:@"a" ofType:@"mp3"];
NSURL *medioUrl=[NSURL fileURLWithPath:[[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"audio/move.mp3"]];
NSError *err=nil;
self.movePlayer=[[AVAudioPlayer alloc] initWithContentsOfURL:medioUrl error:&err];
self.movePlayer.volume=1.0;