The AudioRecorder class defines a recording object for the application. The AudioRecorder object manages recording, calling Audio File Services to interact with the file system.

AQPlayer.h

AQPlayer.m

The AudioPlayer class defines a playback object for the application. The AudioPlayer object manages playback, calling Audio File Services to interact with the file system. Also controls looping of file playback

Version 2.0. Overhauled to use audio queue play and record code from the WWDC aqTouch sample. Metering view now uses OpenGL for graphics.

Version 1.2. Updated for and tested with iPhone OS 2.2.

This version supports recording using all supported iPhone OS audio formats, including:

linear PCM

ALAC (Apple Lossless)

IMA4 (IMA/ADPCM)

iLBC

µLaw

aLaw

This version can play all audio playback formats supported in iPhone OS.

This version also fixes a crashing bug that appeared when guard malloc was enabled. The crash happened because, when tapping Stop during playback, a message was being sent to the playback audio queue object after it had been deallocated. The solution involved the following changes:

AudioPlayer.m

----------------

Changed propertyListenerCallback to delay the message that triggers destruction of the AudioPlayer object until the run loop has completed.

AudioViewController.m

--------------------------

Changed updateUserInterfaceOnAudioQueueStateChange (a delegation method) to release the AudioPlayer only in the case of the sound file having reached the end.

Changed playOrStop:, which responds to the user tapping Stop to stop playback, to release the AudioPlayer after it has finished stopping.