AVAudioEngine: Starting a set of AVAudioPlayerNodes at once

Viewed 1323

I'm working on an app that starts a number of loops simultaneously, and should maintain their sync.

Using previous, naive approaches to the problem (not using AVAudioEngine), I found that programmatically starting a number of audio players in sequence yielded enough delay between calls as to render the results useless; the beats were audibly out of sync.

Can I achieve this kind of functionality using AVAudioEngine?

Currently I'm wiring up AVAudioPlayerNodes to a mixer, and I've attached buffers to them and controlling input from there. But can I have them all start simultaneously?

It seems the nodes don't start producing sound until I call play, and that can't be done before the engine is started...

3 Answers
Related