Audio Here is Apple's overview of media. An "Audio Session" defines how your app's sounds interact with the iOS device. What happens when a call arrives? Will it continue to play in the background? The most elementary way to play a sound is with "System Sound Services". It will play a sound from a file, not more that 30 seconds in duration. This is also the way to make the device vibrate. Here is a sample project. A more powerful way to play sounds is with "AVAudioPlayer". It can play sounds from memory or files for an unlimited time, loop (repeat) and play multiple sounds. It also allows metering and control of the level. See the sample code, "avTouch". AVAudioRecorder will record sounds. Here is a demo project for recording. At a lower level is AVPlayer and Audio Queue Services. AVPlayer is a configurable interface for audio and video streams. Here is a sample project, AVPlayerDemo. Caution, it is rather complex. "Audio Queue Services" allows full recording and playback. It can record or play from files, memory or network streams. It permits the use of "Audio Units" for filtering and converting sound streams. See sample code, "SpeakHere". Note how much easier it is to use AVAudioRecorder. OpenAL is a package that lets you move sounds in space, somewhat like OpenGL lets you move visible objects. It is aimed at game developers. A tutorial on OpenAL. A sample project, oalTouch. MIDI is available in iOS with CoreMIDI framework. A nice sample project is aurioTouch. It shows the use of low-level audio units and the processing of sound streams to show the spectrum of the sound. The project is largely C++. Here is an audio-video How-To Guide The basic document for low level audio is "Core Audio Overview". The page was last updated
Wednesday, May 16, 2012 3:18 PM
|