#ifndef WaveRecordH #define WaveRecordH #include #include #include #include "communication.h" //#include "mainform.h" class WaveRecord { private: public: FILE *lpwavefile, *lpwavetmp; FILE *lpConfigFile; unsigned long ulSize; bool FAllocated; bool FRecording; bool wavetmpopen; bool wavefileopen; short int BufferIndex; HWAVEIN hwi; //HGLOBAL HData1, HWaveHdr, HData2; char *lpData[2]; LPWAVEHDR lpWaveHdr[2]; typedef struct { char RIFFid[4]; //"RIFF" unsigned long wfilesize; //36 + No. of samples char WAVEid[4]; //"WAVE" char fmtid[4]; //"fmt " unsigned long flen; //16 for PCM; unsigned short int tag; //PCM = 1 unsigned short int channel; //channel unsigned long samplingrate; //Sampling rate unsigned long byterate; //Sampling rate * channel * BitsPerSample/8 unsigned short int blockalign; //channel * BitsPerSample/8 unsigned short int bitspersample; //BitsPerSample char dataid[4]; //"data" unsigned long samplesize; //No. of samples( including channel) }waveHeader; waveHeader whder; RecordSet RecSet,*lpRecordSet; bool WaveMakeHeader(); void WaveFreeHeader(); bool WaveRecordOpen(HWND Hwnd); bool WaveRecordBegin(); bool AddQueue(); void WaveRecordEnd(); void WaveRecordClose(); WaveRecord(); ~WaveRecord(); }; #endif