-(IBAction)musiconButtonClicked:(id)sender{
NSString *path = [[NSBundle mainBundle] pathForResource:@"NextRevIt" ofType:@"mp3"];
AVAudioPlayer* audioPlayer = [[AVAudioPlayer alloc ] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
[audioPlayer play];
}
-(IBAction)musicoffButtonClicked:(id)sender{
[audioPlayer stop]; <----says this is undeclared?
}
Je peux obtenir l'audio pour bien jouer, mais comment puis-je faire un bouton qui arrête l'audio?Lecture de mp3 sur iphone sdk?
n'oubliez pas de @syntheize dans le .m et le dealloc comme mentionné ci-dessus. – CW0007007