code_junkie

Multiple audio sounds in iPhone app?

Nov 13th, 2011
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. NSString *path = [[NSBundle mainBundle] pathForResource:@"dream" ofType:@"m4a"];
  2. AVAudioPlayer* theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
  3. theAudio.delegate = self;
  4. [theAudio play];
  5.  
  6. /usr/bin/afconvert -f caff -d ima4 sound.mp3 sound.caf
  7.  
  8. -(void)Play:(NSString*)sSoundFile {
  9. // play sound file here
  10. }
Add Comment
Please, Sign In to add comment