xvi
Foreword
ears led him through its many dark twists and turns, he learned a new language to
describe sound—and, with it, a new way of looking at the universe.
An eternity later, he himself a graying wizard, he thought back on that library to the
missing volumes and realized it was his destiny to shed light on the dark art of Core
Audio. It is the definition of mastery that we must teach what we have learned.This is
the truth that fuels the cycle of master and protégé.This is the engine that drives genera-
tions forward, each propelling the next further ahead as we move toward that grand inef-
fable vanishing point we call the future.
As with all rites of passage, it was a herculean task, requiring a whole new sets of skills
and a different type of discipline.We must tear apart our knowledge, and ourselves, to
find not just truth, but the beauty that underlies the truth and allows it to resonate across
the ages and to be understood.
All such that at some unknowable time in the future, where once there was a dead
end and a blank space between Core Animation and Core Data, some young acolyte
might find wisdom and guidance.They might combine this new knowledge with what
they already know so that, when they find their own dead end and their own dark arts,
they, too, will be ready.
That moment, dear reader, is now.That acolyte is you, and the grimoire that you hold
in your hand has all the wisdom and more than enough spells to take your magic to the
next level.This book is your key to wielding unspeakable power, the power of sound and
nature, the power of Core Audio.
Does all that seem a bit much for a book about audio programming? Rest assured
that, if anything, I have undersold it. Sound is an incredibly powerful force that affects
the human brain in ways we only barely understand. Consider the impact of music on
your life. Now consider that all of music is maybe 10% of the story of sound.
The power of audio programming goes so far beyond anything you can experience
with your ears. Swiping a credit card used to require an expensive machine. Now you
can do the same trick with a cheap plastic dongle plugged into the headphone jack of
your iPhone.You don’t have to make music to make magic with sound.
With this book, you dig into your first Core Audio code in Chapter 1, “Overview of
Core Audio,” even as you are learning what exactly Core Audio is and when you should
(and should not) attempt to use its power.
Core Audio, like all black arts, has roots in the inherent properties of nature. Chapter
2,“The Story of Sound,” takes to heart the story of sound, not as ineffable natural phe-
nomena, but as simple science.You’ll learn the language and techniques of converting
vibrating air molecules into the mathematical language of computers, and vice versa.
Yo u ’ l l a l s o l e a r n t h e h u m a n l a n g u a g e o f a u d i o a n d t h e real meanings of technical
terms you’ve heard, and perhaps even used, for years: sample rate, frame rate, buffer, and
compression.You’ll see these ideas carried through Chapter 3,“Audio Processing with
Core Audio,” as you peel back the wrapper on audio formats and learn about the canon-
ical formats Core Audio uses internally.