Skip to Content
iPhone Open Application Development
book

iPhone Open Application Development

by Jonathan Zdziarski
March 2008
Intermediate to advanced
288 pages
6h 21m
English
O'Reilly Media, Inc.
Content preview from iPhone Open Application Development

Chapter 6. Making Some Noise

If there was ever any doubt whether the iPhone was intended to be a music device, the presence of three different frameworks on the iPhone just for sound should be all the answer you need. The Core Audio, Celestial, and Audio Toolbox frameworks all provide different levels of sound functionality. In addition to this, the iPhone runs an audio daemon called mediaserverd that aggregates the sound output of all applications and governs events such as volume and ringer switch changes. There are a lot of moving pieces involved in the iPhone's sound framework, but Apple has provided some great interfaces that make the task painless.

Core Audio: It's Great, but You Can't Use It

Of the three frameworks available, Core Audio is the most low-level, and least accessible. Core Audio provides a direct interface to the iPhone's sound device. There is only one sound device, so only one process can be talking to it at any time. Unlike the Mac OS X desktop, which allows developers to share Core Audio resources, the iPhone has an audio daemon that binds to the device as the iPhone is booted, setting what is called hog mode. Hog mode is a flag hardcoded into the Core Audio framework that prevents any other application from being able to say, "Hey, I'd like to make some sound, can you give up control of the sound card for a minute?" In other words, the audio daemon hogs the sound card all to itself, requiring all sounds to be played through the daemon instead of directly. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

iPhone Open Application Development, 2nd Edition

iPhone Open Application Development, 2nd Edition

Jonathan Zdziarski

Publisher Resources

ISBN: 9780596518554Errata Page