00001 00002 00003 00004 00005 00006 00007 00008 #ifndef CSL_SoundFileCA_H 00009 #define CSL_SoundFileCA_H 00010 00011 #include "SoundFile.h" 00012 #import <AudioToolbox/ExtendedAudioFile.h> 00013 00014 namespace csl { 00015 00019 00020 class CASoundFile : public Abst_SoundFile { 00021 public: 00022 CASoundFile(CFURLRef path); 00023 CASoundFile(string path, int start = -1, int stop = -1); 00024 CASoundFile(string folder, string path, int start = -1, int stop = -1); 00025 CASoundFile(CASoundFile & otherSndFile); 00026 ~CASoundFile(); 00027 00028 SoundFileFormat format(); 00029 void dump(); 00030 void openForRead() throw (CException); 00031 00032 00033 void openForWrite(SoundFileFormat format = kSoundFileFormatAIFF, 00034 unsigned channels = 1, 00035 unsigned rate = 44100, 00036 unsigned bitDepth = 16) throw (CException); 00037 void openForReadWrite() throw (CException); 00038 void close(); 00039 00040 unsigned seekTo(int position, SeekPosition whence) throw(CException); 00041 void readBufferFromFile(unsigned numFrames); 00042 00043 void writeBuffer(Buffer &inputBuffer) throw (CException); 00044 00045 protected: 00046 void initFromSndfile(); 00047 // void convertFormat(unsigned num, unsigned start); 00048 00049 CFURLRef mURL; 00050 AudioFileID mSoundID; 00051 bool mBigEndian; 00052 }; 00053 00054 } 00055 00056 #endif
1.4.5-20051010