SndAudioProcessorRecorder Class Reference

Records the FX audio stream to disk. More...

#import <SndAudioProcessorRecorder.h>

Inheritance diagram for SndAudioProcessorRecorder:

SndAudioProcessor

List of all members.

Public Member Functions

(BOOL) - isRecording
 Returns whether the receiver is currently recording.
(BOOL) - prepareToRecordForDuration:
 Sets the buffer used for recording.
(BOOL) - startRecording
 YES if recording started ok.
(BOOL) - setUpRecordFile:withFormat:
 Sets up recording of the file in the given format.
(BOOL) - startRecordingToFile:withDataFormat:channelCount:samplingRate:
 Begins recording to the given format in the given format.
(id) - stopRecording
 Stops the recording of the stream to file.
(id) - stopRecordingWait:
 TODO remove this, redundant, always wait until the queue clears.
(long) - framesRecorded
 Returns the number of frames recorded.
(void) - setStartTriggerThreshold:
 Sets the linear amplitude the stream must rise above before recording begins.

Protected Attributes

SndAudioBufferQueuewritingQueue
SndFormat fileFormat
BOOL isRecording
NSFileHandle * writingFileHandle
unsigned long framesRecorded
SNDFILE * recordFile
NSString * recordFileName
BOOL startedRecording
float startTriggerThreshold
BOOL stopSignal


Detailed Description

Records the FX audio stream to disk.

A threshold can be set to prevent silence being recorded prior to the sound. An automatic shutoff after a specifiable period of silence is also possible.


Member Function Documentation

- (BOOL) isRecording  

Returns whether the receiver is currently recording.

Returns:
YES if currently recording.

- (BOOL) prepareToRecordForDuration: (double)  recordDuration  

Sets the buffer used for recording.

Returns:
YES if able to prepare correctly, NO if there was a problem.

- (BOOL) startRecording  

YES if recording started ok.

Returns:
YES if recording started ok.

- (BOOL) setUpRecordFile: (NSString *)  filename
withFormat: (SndFormat format 

Sets up recording of the file in the given format.

This method is not normally called, use startRecordingToFile:withDataFormat:channelCount:samplingRate: instead. This method, setUpRecordFile:withFormat: is defined here in order to facilitate overriding in subclasses.

Returns:
Returns YES if able to open the file for writing, NO if there is an error.

- (BOOL) startRecordingToFile: (NSString *)  filename
withDataFormat: (SndSampleFormat)  dataFormat
channelCount: (int)  chanChan
samplingRate: (int)  samRate 

Begins recording to the given format in the given format.

Returns:
Returns YES if able to open the file for writing, NO if there is an error.

- (id) stopRecording  

Stops the recording of the stream to file.

Returns:
Returns self.

- (id) stopRecordingWait: (BOOL)  wait  

TODO remove this, redundant, always wait until the queue clears.

Returns:
Returns self.

- (long) framesRecorded  

Returns the number of frames recorded.

Returns:
The number of frames recorded.


Member Data Documentation

A queue of buffers copied from those received by processReplacingInputBuffer: ready for writing.

- (SndFormat) fileFormat [protected]

The format of the data to be stored in the file.

- (BOOL) isRecording [protected]

Indicates if recording is currently active.

- (NSFileHandle*) writingFileHandle [protected]

Holds the file handle used in writing.

- (unsigned long) framesRecorded [protected]

Number of sample frames written

- (SNDFILE*) recordFile [protected]

The libsndfile handle referring to the open file. NULL if not open.

- (NSString*) recordFileName [protected]

Full pathname of the file being or about to be written.

- (BOOL) startedRecording [protected]

Indicates if a minimum threshold or time trigger has passed and recording has begun.

- (float) startTriggerThreshold [protected]

A normalised absolute value threshold to begin the recording of sound.

- (BOOL) stopSignal [protected]

A boolean variable to indicate that recording should stop and the file should be closed.


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

Generated on Sat Dec 5 17:01:16 2009 for MusicKit by  doxygen 1.5.6