Is there a way to have a completion handler for each loop when scheduling a buffer?
self.audioPlayerNode.scheduleBuffer(buffer, at: nil, options: .loops, completionHandler: completionHandler)
// call each loop, not only on the buffer end
func completionHandler() {
// code here
}