NSString *path = [[NSBundle mainBundle] pathForResource:filename ofType:@"mp3"];
NSURL *url = [NSURL fileURLWithPath:path];
NSError *error;
AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc]initWithContentsOfURL:url error:&error];
[audioPlayer play];
No comments:
Post a Comment