MPMusicPlayerController doesn't work because it is about iPod music library and I can't add a music file to it since I'm doing an iPhone game and not interacting with the outside iPod library.
Does AVAudioPlayer works in iPhoneSimulator?
MPMusicPlayerController doesn't work because it is about iPod music library and I can't add a music file to it since I'm doing an iPhone game and not interacting with the outside iPod library.
Does AVAudioPlayer works in iPhoneSimulator?
Hi,
Check out following code its a simple AVAudioPlayer example and its work on iPhone simulator too ..
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];