There is an option numberofloops in AVAudioPlayer
which repeats a sound file for a specified number of times.
I have to implement this type of function in AVAudioPlayerNode
and I found an option just to loop a sound file in an infinite number of times in a loop using the following code
audioPlayerNode.scheduleBuffer(audioFileBuffer, atTime: nil, options:.Loops, completionHandler: nil)
Is it possible to repeatedly play a file in a fixed number of times like as AVAudioPlayer
? Is there any code sample to achieve this?