2010-01-26 40 views

回答

1

退房下面的代碼它的一個簡單例子AVAudioPlayer及其對iPhone模擬器上太工作..

AVAudioPlayer * audioPlayer;

NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/azan1.mp3", [[NSBundle mainBundle] resourcePath]]]; 

NSError *error; 
audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error]; 
audioPlayer.numberOfLoops = -1; 

[audioPlayer play]; 
相關問題