Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)playAudioFile:(NSString *)fileName withType:(NSString *)type {
- NSString *soundPath = [[NSBundle mainBundle] pathForResource:fileName ofType:type];
- AVAudioPlayer *newAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:soundPath isDirectory:NO] error:nil];
- self.audioPlayer = newAudio;
- [newAudio release];
- [audioPlayer setDelegate:self];
- audioPlayer.numberOfLoops = 0;
- [audioPlayer play];
- }
Add Comment
Please, Sign In to add comment