Chapter 12. Media: audio and recording

 

This chapter covers

  • Accessing the iPod library to play music
  • Recording audio from the built-in microphone
  • Playing sounds
  • Recording, playing, and accessing video

In the previous chapter, we discussed the basics of images. This chapter will detail how to play and record various types of audio and video. This will include how to play back audio items in the user’s iPod library as well as how to record to and play from the user’s video library.

To further demonstrate these concepts, you’ll create two sample applications. The first application is a simple media player that lets the user choose a song from their iPod library and play it back within the application. The next will be a simple recording and playback application that lets the user record audio of an arbitrary length and play it back.

12.1. Playing audio from the iPod library

You may wonder: why do you want to play music from the iPod music library. Many people bought their fancy new iPhones for the sole purpose of combining their electronics (cell phone, iPod, GPS, camera, and so on).

Apple saw the need for such control within an application and provided the Media Player framework to allow you to retrieve items from the iPod media library as well as play them.

12.2. Recording audio

12.3. Playing sounds

12.4. Example: creating a simple audio recording/playback application

12.5. Recording, playing, and accessing video

12.6. Summary