00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00017
00018 #ifndef __SNDKIT_SNDAUDIOPROCESSORRECORDER_H__
00019 #define __SNDKIT_SNDAUDIOPROCESSORRECORDER_H__
00020
00021
00022
00023
00024
00025
00026
00027 #import "SndKitConfig.h"
00028
00029 #import <Foundation/Foundation.h>
00030 #import "SndAudioProcessor.h"
00031
00032 #if HAVE_LIBSNDFILE
00033 # import <sndfile.h>
00034 #else
00035 #define SNDFILE void
00036 #endif
00037
00038 @class SndAudioBuffer;
00039 @class SndAudioBufferQueue;
00040
00048 enum SndRecorderParam {
00049 recorder_StartTriggerThreshold = 0,
00050 recorder_RecordFile = 1,
00051 recorder_NumParams = 2
00052 };
00053
00055
00063 @interface SndAudioProcessorRecorder : SndAudioProcessor {
00064
00065 @protected
00067 SndAudioBufferQueue *writingQueue;
00069 SndFormat fileFormat;
00071 BOOL isRecording;
00073 NSFileHandle *writingFileHandle;
00075 unsigned long framesRecorded;
00077 SNDFILE *recordFile;
00079 NSString *recordFileName;
00081 BOOL startedRecording;
00083 float startTriggerThreshold;
00085 BOOL stopSignal;
00086 }
00087
00092 - (BOOL) isRecording;
00093
00098 - (BOOL) prepareToRecordForDuration: (double) recordDuration;
00099
00104 - (BOOL) startRecording;
00105
00114 - (BOOL) setUpRecordFile: (NSString *) filename
00115 withFormat: (SndFormat) format;
00116
00121 - (BOOL) startRecordingToFile: (NSString*) filename
00122 withDataFormat: (SndSampleFormat) dataFormat
00123 channelCount: (int) chanChan
00124 samplingRate: (int) samRate;
00125
00130 - stopRecording;
00131
00136 - stopRecordingWait: (BOOL) wait;
00137
00142 - (long) framesRecorded;
00143
00147 - (void) setStartTriggerThreshold: (float) f;
00148
00149 - copyWithZone: (NSZone *) zone;
00150
00151 @end
00152
00154
00155 #endif