Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
  2.     NSString *filePath = [[NSBundle mainBundle] pathForResource:@"0001" ofType:@"caf"];
  3.     NSURL *fileURL = [[NSURL alloc] initFileURLWithPath:filePath];
  4.     AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil];
  5.     [fileURL release];
  6.     [audioPlayer prepareToPlay];
  7.     [audioPlayer play];
  8.     [audioPlayer release];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement