In our last post, we looked at how to access iPod Library tracks and stream them from disk in real time, using Apple’s Extended Audio File Services and Audio Unit APIs. We also speculated about the possibility of modifying our code to allow for reverse playback of those streams – you know, so you can hear what stuff sounds like when you play it backwards. Let’s look at how we might go about that now.
There are two questions that often arise for iOS developers new to Apple’s audio frameworks: (1) How do I play tracks from the iPod Library using the low level Core Audio APIs (as opposed to using an AVAudioPlayer or MPMediaPlayer) and (2) How do I play those tracks without first loading them into memory?
Apple, of course, already provides us with a number of options for accessing and playing iPod Library files. And loading those files into memory before playing them is certainly the easy way to go.
But: sometimes it’s not enough.