// //Constructor // Display::Display(int n):CDialog(n) { isconnected=FALSE; sendcount=0; reccount=0; //create the buffers for playing.....buffers are reused.. PreCreateHeader(); log.Open("log.txt",CFile::modeCreate | CFile::modeWrite); }
RecordSound::RecordSound(CDialog *dialog) { dlg=dialog; log.Open("recfile.txt",CFile::modeCreate | CFile::modeWrite); log.WriteString("In the Recordsound Constructor\n"); //Select the microphone MicPhone *mic=new MicPhone; mic->SetMicrophone(); MicMute *mute=new MicMute; mute->SetMicrophone(); recording=FALSE; isallocated=0; //memory is not allocated to wavebuffer GetDevProperty(); //Create Headers for buffering PreCreateHeader(); //Setting WAVEFORMATEX structure for the audio input memset(&m_WaveFormatEx,0x00,sizeof(m_WaveFormatEx)); m_WaveFormatEx.wFormatTag=WAVE_FORMAT_PCM; m_WaveFormatEx.nChannels=1; m_WaveFormatEx.wBitsPerSample=8; m_WaveFormatEx.cbSize=0; m_WaveFormatEx.nSamplesPerSec=SAMPLERSEC; //22.05 KHz m_WaveFormatEx.nBlockAlign=1; //(m_WaveFormatEx.wBitsPerSample/8)*m_WaveFormatEx.nChannels; m_WaveFormatEx.nAvgBytesPerSec=SAMPLERSEC ; //m_WaveFormatEx.nBlockAlign; }