O'Reilly logo

Xcode 4 Cookbook by Steven F. Daniel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the iOS device's microphone to record

In this recipe we will learn how we can use the iOS device's microphone to record sounds.

Getting ready

Following on from our previous recipe, create a new Single View Application, and name it RecorderExample.

How to do it...

To begin, follow these simple steps as outlined in the following order:

  1. Add a reference to the AVFoundation.framework to your project.
  2. Select the ViewController.xib files from the Project Navigator window.
  3. From the Object Library window, select and drag a UIToolbar object, and add this to our view and select the Item button located within our toolbar.
  4. From the Attributes Inspector section, change the Title property to read Start Recording.
  5. Create the outlet for this UIBarButtonItem

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required