// ViewController.h
@property (nonatomic) AVAudioPlayer *player;
@property (weak, nonatomic) IBOutlet UIButton *playButton;
// ViewController.m
- (IBAction)playButton:(UIButton *)sender {
[_player play];
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSString * filePath = [[NSBundle mainBundle] pathForResource:@"1739" ofType:@"mp3"];
NSURL * url = [NSURL fileURLWithPath:filePath];
_player = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:NULL];
[_player prepareToPlay];
}