Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Hardware Support > Audio Input Availability

Audio Input Availability

You can poll whether audio input is available using the AVAudioSession singleton class by checking the inputIsAvailable class property:

AVAudioSession *audioSession = [AVAudioSession sharedInstance];
BOOL audioAvailable = audioSession.inputIsAvailable;

Note

The AVAudioSession class is part of the AVFoundation.Framework. You’ll also need to import the header:

#import <AVFoundation/AVFoundation.h>

You can also be notified of any changes in the availability of audio input (e.g., a second-generation iPod touch user has plugged in headphones with microphone capabilities). First, nominate your class as a delegate:

audioSession.delegate = self;

Declare it as implementing the AVAudioSessionDelegate protocol in the declaration:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial