I am playing audio in my application using audioPlayer.Play()
and it is play correctly.
i can not find when audio finish. i want delegate method when audio finished.
can you please write method when audio finished?
I am playing audio in my application using audioPlayer.Play()
and it is play correctly.
i can not find when audio finish. i want delegate method when audio finished.
can you please write method when audio finished?
may be it is not possible with audiotoolbox
framework, but what you can try is AVAudioPlayer
.
just try following after adding:
#import <AVFoundation/AVFoundation.h>
then use delegate method below to handle anything when audio finishes playing:
- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag {
// Audio finished playing
//handle anything here
}
set delegate to self
[myAudioPlayer setDelegate:self];
and then implement
-(void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag
{
/*Handle Code here*/
}