아이폰어플개발정보2010. 6. 24. 11:39
mp3를 재생하는 방법

by nik 4. 5월 2009 04:55
//need to add: AVFoundation.framework

#import

NSBundle *mainBundle = [NSBundle mainBundle];

NSURL *url = [NSURL fileURLWithPath:[mainBundle pathForResource:@"game" ofType:@"mp3"] isDirectory:NO];

AVAudioPlayer *gameSoundTrack = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil];

[gameSoundTrack prepareToPlay];

[gameSoundTrack play];



출처 : http://blog.naver.com/PostView.nhn?blogId=amoros21&logNo=140107111290
Posted by 오늘마감

댓글을 달아 주세요