Discussion Forums  >  Uncategorized

Replies: 1    Views: 217

stitchey
Aspiring developer
Profile
Posts: 6
Reg: Jun 05, 2011
Los Angeles
60
06/06/11 03:17 PM (14 years ago)

Play Pause Background music

Ive figured out how to play background music on startup but I would like to be able to pause/resume it with a button. This is my code so far.... NSString *path = [[NSBundle mainBundle] pathForResource:@fool4you ofType:@mp3]; AVAudioPlayer* theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL: [NSURL fileURLWithPath:path] error:NULL]; theAudio.delegate = self; [theAudio play];
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/06/11 03:25 PM (14 years ago)
It's sounding more and more like you're using v1.4. I say this because v1.5 makes these types of things easy. background images, design, audio, etc. Get on the Early Adopter list if you havn't already so you can start using v1.5....all this will make way more sense then.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.