E electronica macrumors newbie Original poster Sep 24, 2011 17 0 Sep 29, 2011 #1 hmm is there any easy way to check if the playing audio is finished? i need to call a method when the audio is finished playing.
hmm is there any easy way to check if the playing audio is finished? i need to call a method when the audio is finished playing.
dejo Moderator emeritus Sep 2, 2004 15,982 454 The Centennial State Sep 29, 2011 #2 Perhaps you could explain, in detail, how you started the audio playing in the first place.
E electronica macrumors newbie Original poster Sep 24, 2011 17 0 Sep 29, 2011 #3 ok, sorry this is my code, and when the mp3 file is finished playing, than i want to call ileri method again. thats all. Code: -(IBAction)ileri { NSString *path = [[NSBundle mainBundle] pathForResource:[sesarray objectAtIndex:deger - 1] ofType:@"mp3"]; theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL]; theAudio.delegate = self; [theAudio setVolume:2.0]; [theAudio play]; } } Last edited by a moderator: Sep 29, 2011
ok, sorry this is my code, and when the mp3 file is finished playing, than i want to call ileri method again. thats all. Code: -(IBAction)ileri { NSString *path = [[NSBundle mainBundle] pathForResource:[sesarray objectAtIndex:deger - 1] ofType:@"mp3"]; theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL]; theAudio.delegate = self; [theAudio setVolume:2.0]; [theAudio play]; } }
jiminaus macrumors 65816 Dec 16, 2010 1,449 1 Sydney Sep 29, 2011 #4 Have a look at the AVAudioPlayerDelegate protocol reference.