Recorder utility, used for recording live audio to disk. More...

#import <AERecorder.h>

Inherits <NSObject>, and <AEAudioReceiver>.

Instance Methods

(id) - initWithAudioController:
 Initialise.
 
(BOOL) - beginRecordingToFileAtPath:fileType:error:
 Prepare and begin recording.
 
(BOOL) - beginRecordingToFileAtPath:fileType:bitDepth:error:
 
(BOOL) - beginRecordingToFileAtPath:fileType:bitDepth:channels:error:
 
(BOOL) - prepareRecordingToFileAtPath:fileType:error:
 Prepare to record.
 
(BOOL) - prepareRecordingToFileAtPath:fileType:bitDepth:error:
 
(BOOL) - prepareRecordingToFileAtPath:fileType:bitDepth:channels:error:
 
(void) - AERecorderStartRecording
 Start recording.
 
(void) - AERecorderStopRecording
 Stop recording.
 
(void) - finishRecording
 Finish recording and close file.
 
- Instance Methods inherited from <AEAudioReceiver>
(void) - setupWithAudioController:
 Perform setup, to prepare to receive audio.
 
(void) - teardown
 Clean up resources.
 

Class Methods

(BOOL) + AACEncodingAvailable
 Determine whether AAC encoding is possible on this device.
 

Properties

NSString * path
 The path.
 
double currentTime
 Current recorded time in seconds.
 
BOOL recording
 Current state of the recorder.
 
- Properties inherited from <AEAudioReceiver>
AEAudioReceiverCallback receiverCallback
 Reference to the receiver callback.
 

Detailed Description

Recorder utility, used for recording live audio to disk.

This can be used to record just the microphone input, or the output of the audio system, just one channel, or a combination of all three. Simply add an instance of this class as an audio receiver for the particular audio you wish to record, using AEAudioController's addInputReceiver:, addOutputReceiver:, forChannel:addOutputReceiver:forChannel:, etc, and all streams will be mixed together and recorded.

See the sample app for a demonstration.

Method Documentation

+ (BOOL) AACEncodingAvailable

Determine whether AAC encoding is possible on this device.

- (id) initWithAudioController: (AEAudioController *)  audioController

Initialise.

Parameters
audioControllerThe Audio Controller
- (BOOL) beginRecordingToFileAtPath: (NSString *)  path
fileType: (AudioFileTypeID)  fileType
error: (NSError **)  error 

Prepare and begin recording.

Prepare to record, then start recording immediately, without needing to call AERecorderStartRecording

Parameters
pathThe path to record to
fileTypeThe kind of file to create
errorThe error, if not NULL and if an error occurs
Returns
YES on success, NO on failure.
- (BOOL) beginRecordingToFileAtPath: (NSString *)  path
fileType: (AudioFileTypeID)  fileType
bitDepth: (UInt32)  bits
error: (NSError **)  error 
- (BOOL) beginRecordingToFileAtPath: (NSString *)  path
fileType: (AudioFileTypeID)  fileType
bitDepth: (UInt32)  bits
channels: (UInt32)  channels
error: (NSError **)  error 
- (BOOL) prepareRecordingToFileAtPath: (NSString *)  path
fileType: (AudioFileTypeID)  fileType
error: (NSError **)  error 

Prepare to record.

Prepare recording and set up internal data structures. When this method returns, the recorder is ready to record.

Start recording by calling AERecorderStartRecording. This allows you to record synchronously with other audio events.

Parameters
pathThe path to record to
fileTypeThe kind of file to create
errorThe error, if not NULL and if an error occurs
Returns
YES on success, NO on failure.
- (BOOL) prepareRecordingToFileAtPath: (NSString *)  path
fileType: (AudioFileTypeID)  fileType
bitDepth: (UInt32)  bits
error: (NSError **)  error 
- (BOOL) prepareRecordingToFileAtPath: (NSString *)  path
fileType: (AudioFileTypeID)  fileType
bitDepth: (UInt32)  bits
channels: (UInt32)  channels
error: (NSError **)  error 
- (void) AERecorderStartRecording (AERecorder *)  recorder

Start recording.

If you prepared recording by calling prepareRecordingToFileAtPath:fileType:error:, call this method to actually begin recording.

This is thread-safe and can be used from the audio thread.

Parameters
recorderThe recorder
- (void) AERecorderStopRecording (AERecorder *)  recorder

Stop recording.

Will stop from recording more data to file. This does not close or flush the file, it only stops any incoming audio from being written. You can later call finishRecording, or call AERecorderStartRecording to continue recording.

This is thread-safe and can be used from the audio thread.

Parameters
recorderThe recorder
- (void) finishRecording

Finish recording and close file.

Property Documentation

- (NSString*) path
readnonatomicstrong

The path.

- (double) currentTime
readnonatomicassign

Current recorded time in seconds.

- (BOOL) recording
readnonatomicassign

Current state of the recorder.


The documentation for this class was generated from the following file: