亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? audioapp.cpp

?? windows embedded ce (wince6.0)上錄音事例程序源碼。可編成.exe在系統上運行。
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
                     return -1;
                }

              // See how many waveOut devices are registered in the system.
             n=waveInGetNumDevs();

             if(0 == n)
             {
             	  RETAILMSG(1, (TEXT( "ERROR: waveInGetNumDevs reported zero devices, we need at least one.")));
                MessageBox(hwnd, TEXT("ERROR: waveInGetNumDevs reported zero devices, we need at least one."), TEXT("NotesApp"), MB_OK | MB_ICONSTOP);
                return -1;
             }


              // Create our WaveIn headers for the bucket brigade
        	ZeroMemory(&whr1,sizeof(whr1));
        	ZeroMemory(&whr2,sizeof(whr2));

             // set up pwfxRec to the format we want to record in: 11kHz, 8bit,  Mono
             ZeroMemory(&wfxRec, sizeof(wfxRec));
             wfxRec.wFormatTag = WAVE_FORMAT_PCM;  // PCM FORMAT
             wfxRec.nChannels = 1; // MONO Sound
             wfxRec.nSamplesPerSec = 11025; // 11 kHz
             wfxRec.wBitsPerSample = 8; // 8 bits per sample
             wfxRec.nBlockAlign = wfxRec.nChannels*wfxRec.wBitsPerSample/8;
             wfxRec.nAvgBytesPerSec = wfxRec.nSamplesPerSec*wfxRec.nBlockAlign;
             wfxRec.cbSize = 0;
             pwfxRec = &wfxRec;

              // Create/Initialize the new file
               hResult=RecordFile.Create(pszWAVFilename,GENERIC_WRITE,
             					   CREATE_ALWAYS,0,(LPVOID*)&pwfxRec,NULL);
               if(ERROR_SUCCESS != hResult) {
                   	RETAILMSG(1, (TEXT("ERROR: Could not Open %s"),pszWAVFilename));
                       return -1;
               }

              // prepare the input buffers which will hold 20msec  worth of audio data at a time
              nBufSize = ((DWORD)(5*wfxRec.nSamplesPerSec)) * wfxRec.nBlockAlign; // ~20 ms buffer
              if(nBufSize < wfxRec.nBlockAlign)
                nBufSize = wfxRec.nBlockAlign; // make sure we don't go too small, or else we'll get exceptions
              data1 = new char[nBufSize];
              data2 = new char[nBufSize];
              if(!data1 || !data2)
              {
                    RETAILMSG(1, (TEXT("ERROR: OOM. Could not allocate capture buffers.")));
                    return -1;
              }

              ZeroMemory(data1,nBufSize);
              ZeroMemory(data2,nBufSize);

              // Open the Wave Intput Stream
              mmRtn = waveInOpen(&hwi,dwDeviceID,&wfxRec, (DWORD)hwnd,0,CALLBACK_WINDOW);
              if(MMSYSERR_NOERROR != mmRtn) {
              	RETAILMSG(1, (TEXT("ERROR: waveInOpen failed with return code %d"), mmRtn));
                     return mmRtn;
              }

               // Prepare first header
              whr1.lpData = data1;
              whr1.dwBufferLength = nBufSize;
              whr1.dwLoops = 0; // Do not set looping flags and dwLoops anymore
              whr1.dwFlags = 0;  // Just Set them to 0

              mmRtn = waveInPrepareHeader(hwi,&whr1,sizeof(whr1));
              if(MMSYSERR_NOERROR != mmRtn) {
              	RETAILMSG(1, (TEXT("ERROR: waveInPrepareHeader failed with return code %d"), mmRtn));
                     return mmRtn;
              }


              // Prepare second header
              whr2.lpData = data2;
              whr2.dwBufferLength = nBufSize;
              whr2.dwLoops = 0; // Do not set looping flags and dwLoops anymore
              whr2.dwFlags = 0; // Just Set them to 0

              mmRtn = waveInPrepareHeader(hwi,&whr2,sizeof(whr2));
              if(MMSYSERR_NOERROR != mmRtn) {
              	RETAILMSG(1, (TEXT("ERROR: waveInPrepareHeader failed with return code %d"), mmRtn));
                     return mmRtn;
              }

              // Pass both buffers to the driver to be queued up
              mmRtn = waveInAddBuffer(hwi, &whr1, sizeof(WAVEHDR));
              if(mmRtn != MMSYSERR_NOERROR)
              {
                    RETAILMSG(1, (TEXT("ERROR: waveInAddBuffer failed with return code %d"), mmRtn));
                    return mmRtn;
              }
              dwNumCaptureBuffers = 1;

              mmRtn = waveInAddBuffer(hwi, &whr2, sizeof(WAVEHDR));
              if(mmRtn != MMSYSERR_NOERROR)
              {
                    RETAILMSG(1, (TEXT("ERROR: waveInAddBuffer failed with return code %d"), mmRtn));
                    return mmRtn;
              }
              dwNumCaptureBuffers++;

              RETAILMSG(1, (TEXT("Capture Buffers Queued up")));

              // start the recording
              mmRtn = waveInStart(hwi);
              if(mmRtn != MMSYSERR_NOERROR)
              {
                    RETAILMSG(1, (TEXT("ERROR: waveInStart failed with return code %d"), mmRtn));
                    return mmRtn;
              }

              bIsRecordingPaused = false;

              RETAILMSG(1, (TEXT("Capture Started")));

              return 0;
              break;
        case WM_PLAY_WAVEFILE:
              // Play the given wavefile
             pszWAVFilename = (LPTSTR)lParam;

             if(NULL == pszWAVFilename)
                {
                     // no/invalid file name given
                     MessageBox(hwnd, TEXT("WAVE File Name was NULL"), TEXT("NotesApp"), MB_OK | MB_ICONSTOP);
                     return -1;
                }

              // See how many waveOut devices are registered in the system.
             n=waveOutGetNumDevs();

             if(0 == n)
             {
             	  RETAILMSG(1, (TEXT( "ERROR: waveOutGetNumDevs reported zero devices, we need at least one.")));
                MessageBox(hwnd, TEXT("ERROR: waveOutGetNumDevs reported zero devices, we need at least one."), TEXT("NotesApp"), MB_OK | MB_ICONSTOP);
                return -1;
             }

             hResult=WaveFile.Create(pszWAVFilename,GENERIC_READ,
             					   OPEN_EXISTING,0,(LPVOID*)&pwfx,NULL);
             if(ERROR_SUCCESS != hResult) {
                 	RETAILMSG(1, (TEXT("ERROR: Could not Open %s"),pszWAVFilename));
                     return -1;
             }


              // Create our WaveOut headers for the bucket brigade
        	ZeroMemory(&wh1,sizeof(wh1));
        	ZeroMemory(&wh2,sizeof(wh2));

              dwNumPlaybackBuffers = 0;  // in case something bad happened in a previous playback loop make sure we start at a good value.

              // allocate 2 fixed sized buffers for the bucket brigade
              // buffer size needs to be a multiple of the block alignment (tight loop in driver makes some assumptions)
              wh1.dwBufferLength = ((DWORD)(( pwfx->nSamplesPerSec)+1)) * pwfx->nBlockAlign; // ~20 ms buffer
              if(wh1.dwBufferLength < pwfx->nBlockAlign)
                wh1.dwBufferLength = pwfx->nBlockAlign; // make sure we don't go too small, or else we'll get exceptions

              wh2.dwBufferLength = wh1.dwBufferLength;

              RETAILMSG(1, (TEXT("NOTE: dwBufferLength is %d"), wh1.dwBufferLength));

              // Allocate Space for the playback Buffers
              playData1 = new char[wh1.dwBufferLength];
              playData2 = new char[wh2.dwBufferLength];
              if(!playData1 || !playData2)
              {
                    RETAILMSG(1, (TEXT("ERROR: OOM. Could not allocate playback buffers.")));
                    return -1;
              }

              ZeroMemory(playData1,wh1.dwBufferLength);
              ZeroMemory(playData2,wh2.dwBufferLength);

              wh1.lpData = playData1;
              wh2.lpData = playData2;

              // Fill the buffers
              WaveFile.ReadData(wh1.lpData,wh1.dwBufferLength,&nBytes);
              if(nBytes != wh1.dwBufferLength) {
              	RETAILMSG(1, (TEXT("ERROR: Could not read a buffer's worth of data from the file.")));
                     return -1;
              }

              WaveFile.ReadData(wh2.lpData,wh2.dwBufferLength,&nBytes);
              if(nBytes != wh2.dwBufferLength) {
              	RETAILMSG(1, (TEXT("ERROR: Could not read a buffer's worth of data from the file.")));
                     return -1;
              }

              // Open the Wave Output Stream
              mmRtn = waveOutOpen(&hwo,dwDeviceID,pwfx, (DWORD)hwnd,0,CALLBACK_WINDOW);
              if(MMSYSERR_NOERROR != mmRtn) {
              	RETAILMSG(1, (TEXT("ERROR: waveOutOpen failed with return code %d"), mmRtn));
                     return mmRtn;
              }

               // Prepare first header
              mmRtn = waveOutPrepareHeader(hwo,&wh1,sizeof(wh1));
              if(MMSYSERR_NOERROR != mmRtn) {
              	RETAILMSG(1, (TEXT("ERROR: waveOutPrepareHeader failed with return code %d"), mmRtn));
                     return mmRtn;
              }

              // Prepare second header
              mmRtn = waveOutPrepareHeader(hwo,&wh2,sizeof(wh2));
              if(MMSYSERR_NOERROR != mmRtn) {
              	RETAILMSG(1, (TEXT("ERROR: waveOutPrepareHeader failed with return code %d"), mmRtn));
                     return mmRtn;
              }

              // Pass the headers to the waveAPI so that they can be queued up to play

              // Write out the header to the waveform audio output stream
              mmRtn=waveOutWrite(hwo,&wh1,sizeof(wh1));
              if(MMSYSERR_NOERROR != mmRtn) {
              	RETAILMSG(1, (TEXT("ERROR: waveOutWrite failed with return code %d"), mmRtn));
                     return mmRtn;
              }

              dwNumPlaybackBuffers++; // increment number of Playback Buffers we are tracking

              mmRtn=waveOutWrite(hwo,&wh2,sizeof(wh2));
              if(MMSYSERR_NOERROR != mmRtn) {
              	RETAILMSG(1, (TEXT("ERROR: waveOutWrite failed with return code %d"), mmRtn));
                     return mmRtn;
              }

              dwNumPlaybackBuffers++; // increment number of Playback Buffers we are tracking

              return 0;
              break;
       case WM_RECORD_STOP:
              // Stop recording the current WAVFILE
              // Stop the capture stream
             if(hwi)
             {
                    mmRtn = waveInStop(hwi);
                    if(mmRtn != MMSYSERR_NOERROR)
                        {
                            RETAILMSG(1, (TEXT("ERROR: waveInStop failed with return code %d"), mmRtn));
                            return mmRtn;
                        }

                    mmRtn = waveInReset(hwi);
                    if(mmRtn != MMSYSERR_NOERROR)
                        {
                            RETAILMSG(1, (TEXT("ERROR: waveInReset failed with return code %d"), mmRtn));
                            return mmRtn;
                        }


                    // at this point we need to wait for all capture buffers to be returned from the driver
                    // waveInReset should speed this along.
                    // once all the buffers are returned and all data is written out to file, the WM_RECORD_FINISHED
                    // message will be sent and we'll take care of writing out that data and closing the file and streams
                    bStopRecording = true; // this tells the MM_WIM_DATA handler to not pass any finished buffers back to the driver
              }
              else
                  RETAILMSG(1, (TEXT("hwi was NULL in STOP")));

              return 0;
              break;
        case WM_RECORD_FINISHED:
              // If we are processing this message, then we assume that all capture buffers have been returned
              // from the driver and written to the file. We will now close out the file
              if(hwi)
              {
                    mmRtn = waveInClose(hwi);
                    if(mmRtn != MMSYSERR_NOERROR)
                        {
                            RETAILMSG(1, (TEXT("ERROR: waveInClose failed with return code %d"), mmRtn));
                            return mmRtn;
                        }
                    hwi = NULL;
              }
              else
                  RETAILMSG(1, (TEXT("hwi was NULL")));

              // Close the file
              RecordFile.Close();

              RETAILMSG(1, (TEXT("Captured file should be closed now.")));

              // reset for next use
              bStopRecording = false;

              // Enable the Record Button
              EnableWindow(hwndRecordButton, true);

              return 0;
              break;
        case WM_PLAYBACK_FINISHED:
              // If we are processing this message, then we assume that all playback buffers have been returned
              // from the driver. We will now close out the file(s)
              if(hwo)
              {
                    mmRtn = waveOutClose(hwo);
                    if(mmRtn != MMSYSERR_NOERROR)
                        {
                            RETAILMSG(1, (TEXT("ERROR: waveOutClose failed with return code %d"), mmRtn));
                            return mmRtn;
                        }
                    hwo = NULL;
              }
              else
                  RETAILMSG(1, (TEXT("hwo was NULL")));

              // Close the file
              WaveFile.Close();

              RETAILMSG(1, (TEXT("Playback file should be closed now.")));

              // reset this for next use
              bStopPlaying = false;

              // Enable the Play button
              EnableWindow(hwndPlayButton, true);

              return 0;
              break;
        case WM_PLAY_STOP:
              // stop playing the current WAVEFILE

              // stop the playback stream
              if(hwo)
              {
                    mmRtn = waveOutReset(hwo);
                    if(mmRtn != MMSYSERR_NOERROR)
                    {
                        RETAILMSG(1, (TEXT("ERROR: waveOutReset failed with return code %d"), mmRtn));
                        return mmRtn;
                    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费av网站大全久久| 欧美一级二级在线观看| 色菇凉天天综合网| 精品国产三级电影在线观看| 亚洲欧美乱综合| 国产精一区二区三区| 欧美亚洲丝袜传媒另类| 亚洲国产成人在线| 极品少妇xxxx偷拍精品少妇| 欧美性猛交xxxx乱大交退制版 | 欧美va亚洲va国产综合| 一区二区三区四区中文字幕| 国产精品久久久久久久久快鸭| 国产精品毛片a∨一区二区三区| 午夜精品久久久久久久| av一区二区不卡| 久久综合九色综合欧美就去吻| 亚洲成av人片在www色猫咪| 不卡电影一区二区三区| 久久影院午夜论| 久久av资源网| 欧美一级电影网站| 日日欢夜夜爽一区| 欧美日韩国产首页在线观看| 亚洲欧美另类久久久精品| 欧美日本高清视频在线观看| 一区av在线播放| 色诱亚洲精品久久久久久| 国产精品欧美一区二区三区| 日本成人中文字幕| 国产乱淫av一区二区三区| 国产精品家庭影院| 91精品麻豆日日躁夜夜躁| 国产蜜臀97一区二区三区 | 亚洲欧美中日韩| 国产成人aaa| 国产精品视频免费看| 久久精品国产秦先生| 欧美一级欧美三级在线观看| 日本麻豆一区二区三区视频| 欧美一区二区三区视频在线观看 | 欧美午夜影院一区| 成人av动漫网站| 中日韩免费视频中文字幕| 日韩欧美激情四射| 欧美午夜精品久久久久久孕妇| 国产91精品一区二区麻豆网站| 成人免费视频播放| 国产一区二区三区在线观看免费视频| 色婷婷激情久久| 欧美亚洲国产怡红院影院| 蜜桃久久av一区| www国产成人免费观看视频 深夜成人网| 激情伊人五月天久久综合| 久久影院电视剧免费观看| 99re这里只有精品视频首页| 亚洲综合无码一区二区| 91精品国产综合久久精品麻豆| 久久电影网电视剧免费观看| 国产午夜精品理论片a级大结局| av综合在线播放| 日韩一区欧美二区| 欧美激情在线看| 欧美三区免费完整视频在线观看| 日本特黄久久久高潮| 中文字幕一区视频| 51午夜精品国产| 成人三级在线视频| 亚洲国产wwwccc36天堂| 久久久www成人免费无遮挡大片| 99久久免费国产| 六月婷婷色综合| 亚洲美女在线国产| 精品国产91洋老外米糕| 色域天天综合网| 国产精品996| 午夜久久久久久电影| 欧美国产成人在线| 欧美美女黄视频| eeuss国产一区二区三区| 蜜桃av一区二区在线观看| 综合欧美亚洲日本| 欧美变态tickle挠乳网站| 色婷婷综合久色| 国产福利精品一区| 日本在线不卡一区| 亚洲综合久久久| 国产欧美中文在线| 欧美大片顶级少妇| 欧美亚洲动漫精品| 成人做爰69片免费看网站| 日本中文一区二区三区| 亚洲午夜精品一区二区三区他趣| 国产精品视频你懂的| xnxx国产精品| 日韩欧美成人午夜| 欧美日本韩国一区| 欧美色图免费看| 99久久久久免费精品国产| 风流少妇一区二区| 国产精品主播直播| 欧美日韩一级片在线观看| 99久久99久久精品免费观看 | 91精品欧美一区二区三区综合在 | 3d成人动漫网站| 欧美女孩性生活视频| 欧美中文一区二区三区| 91蜜桃在线免费视频| 99久久婷婷国产综合精品电影| 国产成人精品一区二| 国产精品1区2区3区| 狠狠久久亚洲欧美| 精品制服美女久久| 久久99国产精品免费| 美女视频第一区二区三区免费观看网站| 亚洲午夜在线观看视频在线| 亚洲综合在线视频| 亚洲妇熟xx妇色黄| 性欧美疯狂xxxxbbbb| 日韩在线一二三区| 日韩高清一区在线| 久久99九九99精品| 国产麻豆日韩欧美久久| 国产成人自拍网| 成人开心网精品视频| av在线播放一区二区三区| 一本久道久久综合中文字幕| 日本二三区不卡| 欧美男男青年gay1069videost| 欧美高清视频一二三区| 精品国产免费人成电影在线观看四季| 日韩精品中文字幕一区| 国产欧美精品区一区二区三区 | 色94色欧美sute亚洲线路一久| 91国偷自产一区二区三区成为亚洲经典 | 久久综合丝袜日本网| 国产午夜精品美女毛片视频| 亚洲日韩欧美一区二区在线| 亚洲精品你懂的| 日韩成人免费在线| 大桥未久av一区二区三区中文| 国产精品99久久不卡二区| 日本乱人伦一区| 欧美不卡一区二区三区四区| 欧美激情综合五月色丁香| 一区二区三区欧美在线观看| 美洲天堂一区二卡三卡四卡视频| 国产一区二区网址| 日本道精品一区二区三区| 欧美一区二区二区| 中文字幕一区二区在线播放| 午夜精品福利一区二区三区蜜桃| 经典三级视频一区| 在线观看亚洲一区| 26uuu成人网一区二区三区| 亚洲激情av在线| 国产精品亚洲午夜一区二区三区| 色婷婷综合久久久中文字幕| 欧美成人猛片aaaaaaa| 一区在线观看视频| 久久国内精品自在自线400部| 北条麻妃国产九九精品视频| 日韩欧美综合在线| 亚洲欧美日韩精品久久久久| 久久综合综合久久综合| 91免费精品国自产拍在线不卡| 日韩欧美电影一区| 亚洲一区二区在线观看视频| 国产真实乱子伦精品视频| 欧美无人高清视频在线观看| 久久精品人人爽人人爽| 亚洲成人精品一区| 99久久国产综合精品女不卡| 欧美成人欧美edvon| 亚洲va韩国va欧美va精品 | 在线观看日韩精品| 26uuu欧美| 久久狠狠亚洲综合| 51精品久久久久久久蜜臀| 亚洲男人的天堂av| 成人激情开心网| 国产亚洲一区二区三区四区| 亚洲成a人片在线观看中文| 91在线观看成人| 国产精品美女久久久久久| 国产a久久麻豆| 26uuu色噜噜精品一区| 精品一区二区三区在线观看国产 | 在线免费观看视频一区| 中文字幕日韩欧美一区二区三区| 九一久久久久久| 欧美sm美女调教| 免费av网站大全久久| 欧美一区二区三区日韩视频| 亚洲一级二级在线| 欧美午夜电影在线播放| 亚洲精品成人少妇| 欧洲生活片亚洲生活在线观看| 亚洲同性gay激情无套| 99国产精品久久久久|