Saturday, September 13, 2014

iOS AVAudioPlayer mp3 재생

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