00001 00002 00003 00004 00005 00006 00007 00008 #ifndef CSL_SoundFileCA_H 00009 #define CSL_SoundFileCA_H 00010 00011 //#import <AudioToolbox/AudioToolbox.h> 00012 #import <AudioToolbox/ExtendedAudioFile.h> 00013 #include "SoundFile.h" 00014 00015 namespace csl { 00016 00020 00021 class CASoundFile : public Abst_SoundFile { 00022 public: 00023 CASoundFile(CFURLRef path); 00024 CASoundFile(string path, int start = -1, int stop = -1); 00025 CASoundFile(string folder, string path, int start = -1, int stop = -1); 00026 CASoundFile(CASoundFile & otherSndFile); 00027 ~CASoundFile(); 00028 00029 SoundFileFormat format(); 00030 void dump(); 00031 void openForRead() throw (CException); 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.5.8