Achievement Unlocked: Finish “Learning Core Audio”

There’s nothing like losing your editor — to Apple, no less — to ratchet up the heat to finish a book that has been too long on the burner. But with Chuck doing exactly that at the end of December, Kevin and I had the motivation to push aside our clients and other commitments long enough to finally finish the Learning Core Audio book (yes, the title is new), and send it off to the production process.

In our final push, we went through the tech review comments and reported errata — Lion broke a lot of our example code — and ended up rewriting every example in the book as Xcode 4 projects, moving the base SDK to Snow Leopard, which allowed us to ditch all the old Component Manager dependencies. For the iOS chapter, we rev’ed up to iOS 4 as a baseline and tested against iOS 5.

One of the advantages of Xcode 4 is that the source directory is cleaner for source control (no more ever-changing build folder that you have to avoid committing), while also offering a pretty simple way to get to the “derived data” folder with the build result, which was important for us because we have a number of command-line examples that create audio files relative to the executable, and Xcode 4 makes them easy to find.

In our final push, we also managed to get in an exercise with the AUSampler, the MIDI instrument that pitch-shifts the audio file of your choice, into the wrap-up chapter. So that should keep things nice and fresh. Thanks to Apple for finally providing public guidance on how to get the .aupreset file to load into the audio unit, and how the unit deals with absolute paths to the sample audio in the app bundle case.

Updated code is available from my Dropbox:

From here, Pearson will take a few months to layout the book, run it by us for proofing and fixes, and send it off to the printer. So… paper copies probably sometime in Spring. The whole book — minus this last round of corrections — is already on Safari Books Online, and will be updated as it goes through Pearson’s production process.

It seems like there’s been a big uptake in Core Audio in the last year or two. More importantly, we’ve moved from people struggling through the basics of Audio Queues for simple file playback (back in iPhone OS 2.0 when Core Audio was the only game in town for media) and now we see a lot of questions about pushing into interesting uses of mixing, effects, digital signal processing, etc. Enough people have gotten sufficiently unblocked that there’s neat stuff going on in this area, and we’re fortunate to be part of it.

Comments (6)

  1. Fantastic! I know a number of people (myself included) who have been anxiously anticipating the release of this book. I can’t wait to get my hands on it.

  2. coveloper

    Congrats Chris! Looking forward to it!!!

  3. nertopia

    Looking forward to your book. I will be “in-line” to buy it! BTW… Do you know if it is possible to split a route on an iPad device? I know how to create an audio session, read properties, and change routes… But for instance can you record audio from the headphone jack while playing back from the internal speaker on the iPad? In other words split the route?

  4. yarshure

    code require :
    CH08_AUGraphInput need code CARingBuffer.h and CARingBuffer.cpp


  5. yarshure: The CARingBuffer stuff is described in the book. It is part of the Core Audio utility library proved by Apple as part of the SDK. Unfortunately, the version provided with Xcode for Snow Leopard has a buggy version of CARingBuffer, so you need to download the updated version (see QA 1665 CoreAudio PublicUtility – Installing the CARingBuffer Update). The Xcode 4.2 build for Lion installs the correct version.

  6. ronanoc

    I just got the book, so looking forward to going through it all summer.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.