Is it possible in AVAudioPlayerNode to loop an audio sound for a number of times only instead of infinite times? The below code scheduled the audio for an infinite number of times instead of saying 5 times.
aVAudioPlayerNode.scheduleBuffer(buffer!, at: nil, options: AVAudioPlayerNodeBufferOptions.loops, completionHandler: nil)
I am looking similar as AVAudioPlayer's as numberOfLoops to define how many times to play an audio. I could use AVAudioPlayer but there is no functionality to play with audio pitch.