Challenging question for AVAudioEngine experts:
Imagine coverflow for sound. You can skim through hundreds of large compressed files rapidly. Now imagine you can do so simultaneously in 6 tracks.
My current solution rapidly loads AVAudioPlayerNode+AVAudioFile+AVAudioUnitEQ instances, hooks them up to AVAudioEngine and plays them. As soon as they become inaudible, these objects get disconnected and discarded. Resulting in random low level AVFoundation crashes and memory leaks (bug reports submitted).
I'm guessing it is not a good idea to reconfigure the audio chain so frequently, but rather set it all up upon app launch and then reuse a set of AVAudioPlayers on which the app rapidly schedules new buffers as needed. Will try that next. Most memory leaks seem to emerge from AVAudioFile though, in particular the format and channel layout description objects.
Thoughts?
- Franz