Is there any possibility to identify if the AVAudioEngine
did finish its played sound? In the past I used the AVAudioPlayer
's function:
func audioPlayerDidFinishPlaying(player: AVAudioPlayer, successfully flag: Bool) {
// Code after finished the played sound
}
Now I need some effects, but there is no func of AVAudioEnginge
provided that identifies the end of the played sound.
I searched a lot, but unfortunately I found only this func in the documentation of AVAudioEngine
:
var running: Bool { get }
My current solution will be to check the "running" boolean, if it's false the player is not playing anymore. Does somebody know a better solution for AVAudioEngine
? Thank you very much!