|
Windows环境下的麦克风录音系统(15) { if(nIDEvent == 1) { static const int xCon = 13; static const int yCon = 13; static const int wCon = 623; static const int hCon = 80; CClientDC dc(this); CBitmap Bitmap; CBitmap * pbmOld = NULL; CDC dcMem; dcMem.CreateCompatibleDC(&dc); Bitmap.CreateCompatibleBitmap(&dc,wCon,hCon); pbmOld = dcMem.SelectObject(&Bitmap); dcMem.PatBlt(0,0,wCon,hCon, WHITENESS); dcMem.MoveTo(0,hCon/2); // // display incomming signal--key idea! // for(int x =0 ; x < wCon; x++) // display Input { dcMem.LineTo(x,(hCon >> 1) - (theSoundCapture().InputBuffer[x] >> 7)); } dc.BitBlt(xCon,yCon,wCon,hCon,&dcMem, 0, 0, SRCCOPY); dcMem.SelectObject(pbmOld); dcMem.DeleteDC(); } else CDialog::OnTimer(nIDEvent); } 5.点击停止(Stop)按钮的时候停止录音和写WAV文件 void CMicDemoDlg::OnStop() { // TODO: Add your control notification handler code here
|