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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? audioapp.cpp

?? windows embedded ce (wince6.0)上錄音事例程序源碼。可編成.exe在系統(tǒng)上運行。
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
#include <windows.h>
#include <mmsystem.h>
#include "CWaveFile.h"


#define MAX_FILENAME_LENGTH 200
#define WM_PLAY_WAVEFILE    (WM_USER + 1)
#define WM_RECORD_WAVEFILE  (WM_USER + 2)
#define WM_RECORD_STOP  (WM_USER + 3)
#define WM_PLAY_STOP    (WM_USER + 4)
#define WM_RECORD_PAUSE    (WM_USER + 5)
#define WM_PLAY_PAUSE  (WM_USER + 6)
#define WM_RECORD_FINISHED  (WM_USER + 7)
#define WM_PLAYBACK_FINISHED  (WM_USER + 8)

#define PLAY_BUTTON_ID 100
#define PLAY_EDITBOX_ID 101
#define PLAY_STOP_BUTTON_ID 102
#define PLAY_PAUSE_BUTTON_ID 103
#define RECORD_BUTTON_ID 104
#define RECORD_EDITBOX_ID 105
#define RECORD_STOP_BUTTON_ID 106
#define RECORD_PAUSE_BUTTON_ID 107


LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	HDC hdc;
	PAINTSTRUCT ps;
	RECT rect;

       static CWaveFile WaveFile;
       static CWaveFile RecordFile;
	static WAVEHDR wh1, wh2;
       static WAVEHDR whr1, whr2; // the r is for recording
       LPWAVEHDR lpwhdr;
	static LPWAVEFORMATEX pwfx;
	static LPWAVEFORMATEX pwfxRec;
       static WAVEFORMATEX wfxRec;
	MMRESULT mmRtn;
	DWORD nBytes = 0;
	static HRESULT hResult;
	BOOL bRet = true;
	static HWAVEOUT hwo;
       static HWAVEIN hwi;
	DWORD dwDeviceID = 0; // WAVE DEVICE ID to use
       int n = 0; // hold number of wavedevices
       static bool bIsPlaybackPaused = false;
       static bool bIsRecordingPaused = false;
       static bool bStopPlaying = false;
       static bool bStopRecording = false;
       char* data1 = NULL;
       char* data2 = NULL;
       char* playData1 = NULL;
       char* playData2 = NULL;
       static int nBufSize;
       static int nPlaybackBufSize;
       DWORD dwBytesRecorded = 0;
       static DWORD dwBytesWritten;
       static DWORD dwNumCaptureBuffers;
       static DWORD dwNumPlaybackBuffers;

       // GUI components
       static HWND hwndPlayButton;
       static HWND hwndPlayEditBox;
       static HWND hwndPlayStopButton;
       static HWND hwndPlayPauseButton;
       static HWND hwndRecordButton;
       static HWND hwndRecordEditBox;
       static HWND hwndRecordStopButton;
       static HWND hwndRecordPauseButton;
       LPCTSTR pszWAVFilename = NULL;

       int height;
       int width;

	switch(message)
	{
	case WM_CREATE:
            height = GetSystemMetrics(SM_CYSCREEN);
            width = GetSystemMetrics(SM_CXSCREEN);

            // set up the Play Wave Button
            hwndPlayButton = CreateWindow(TEXT("BUTTON"),   // class name
                                                             TEXT("Play Wave"), // window name/text
                                                             WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, // style
                                                             10, // x
                                                             10, // y
                                                             75, // width
                                                             25, // height
                                                             hwnd, // hwndParent
                                                             (HMENU)PLAY_BUTTON_ID, // child window identifier
                                                             ((LPCREATESTRUCT)lParam)->hInstance, // hInstance
                                                             NULL);
            // check to make sure CreateWindow Didn't Fail

            // set up the WaveFile Name Edit Box
            hwndPlayEditBox = CreateWindow(TEXT("EDIT"), // class name
                                                               TEXT("release\\22050_16b_S.wav"), // window name/text
                                                               WS_CHILD | WS_VISIBLE | ES_LEFT | WS_BORDER, // style
                                                               100, // x
                                                               10, // y
                                                               200, // width
                                                               25, //height
                                                               hwnd, // hwndParent
                                                               (HMENU)PLAY_EDITBOX_ID, // child window identifier
                                                               ((LPCREATESTRUCT)lParam)->hInstance, // hInstance
                                                               NULL);

            // check to make sure CreateWindow Didn't Fail

            // set up the Stop Playback Button
            hwndPlayStopButton = CreateWindow(TEXT("BUTTON"), // class name
                                                               TEXT("Stop"), // window name/text
                                                               WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, // style
                                                               240, // x
                                                               100, // y
                                                               60, // width
                                                               25, //height
                                                               hwnd, // hwndParent
                                                               (HMENU)PLAY_STOP_BUTTON_ID, // child window identifier
                                                               ((LPCREATESTRUCT)lParam)->hInstance, // hInstance
                                                               NULL);

            // check to make sure CreateWindow Didn't Fail


             // set up the Pause Playback Button
            hwndPlayPauseButton = CreateWindow(TEXT("BUTTON"), // class name
                                                               TEXT("Pause"), // window name/text
                                                               WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, // style
                                                               420, // x
                                                               10, // y
                                                               60, // width
                                                               25, //height
                                                               hwnd, // hwndParent
                                                               (HMENU)PLAY_PAUSE_BUTTON_ID, // child window identifier
                                                               ((LPCREATESTRUCT)lParam)->hInstance, // hInstance
                                                               NULL);

            // check to make sure CreateWindow Didn't Fail


            // set up the Record Wave Button
            hwndRecordButton = CreateWindow(TEXT("BUTTON"), // class name
                                                                 TEXT("Record Wave"), // window name/text
                                                                 WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, // style
                                                                 10, // x
                                                                 45, // y
                                                                 100, // width
                                                                 25, // height
                                                                 hwnd, // hwndParent
                                                                 (HMENU)RECORD_BUTTON_ID, // child window identifier
                                                                 ((LPCREATESTRUCT)lParam)->hInstance, // hInstance
                                                                 NULL);

            // check to make sure CreateWindow Didn't Fail

            // set up the Record to File Name Edit box
            hwndRecordEditBox = CreateWindow(TEXT("EDIT"), // class name
                                                               TEXT("release\\MyRecording.wav"), // window name/text
                                                               WS_CHILD | WS_VISIBLE | ES_LEFT | WS_BORDER, // style
                                                               120, // x
                                                               45, // y
                                                               200, // width
                                                               25, //height
                                                               hwnd, // hwndParent
                                                               (HMENU)RECORD_EDITBOX_ID, // child window identifier
                                                               ((LPCREATESTRUCT)lParam)->hInstance, // hInstance
                                                               NULL);

            // check to make sure CreateWindow Didn't Fail

            // set up the stop recording button
            hwndRecordStopButton = CreateWindow(TEXT("BUTTON"), // class name
                                                               TEXT("Stop"), // window name/text
                                                               WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, // style
                                                               240, // x
                                                               145, // y
                                                               60, // width
                                                               25, //height
                                                               hwnd, // hwndParent
                                                               (HMENU)RECORD_STOP_BUTTON_ID, // child window identifier
                                                               ((LPCREATESTRUCT)lParam)->hInstance, // hInstance
                                                               NULL);

            // check to make sure CreateWindow Didn't Fail

            // set up the Pause Recording Button
            hwndRecordPauseButton = CreateWindow(TEXT("BUTTON"), // class name
                                                               TEXT("Pause"), // window name/text
                                                               WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, // style
                                                               420, // x
                                                               45, // y
                                                               60, // width
                                                               25, //height
                                                               hwnd, // hwndParent
                                                               (HMENU)RECORD_PAUSE_BUTTON_ID, // child window identifier
                                                               ((LPCREATESTRUCT)lParam)->hInstance, // hInstance
                                                               NULL);

            // check to make sure CreateWindow Didn't Fail


		return 0;
		break;
       case WM_COMMAND:
              if(LOWORD(wParam) == PLAY_BUTTON_ID && HIWORD(wParam) == BN_CLICKED )
              {
                    // Play Wave button was clicked

                   // read the file name from the edit box and send the info in the WM_PLAY_WAVEFILE message
                    int iTextLength = GetWindowTextLength(hwndPlayEditBox);
                    if(0 == iTextLength)
                        {
                            // control has no text
                            MessageBox(hwnd, TEXT("Edit Box has no text. No WAV file to play."), TEXT("NotesApp"), MB_OK | MB_ICONSTOP);
                            return 0;
                        }
                    else if(MAX_FILENAME_LENGTH < iTextLength)
                        {
                             // filename exceeds max length of filename
                            MessageBox(hwnd, TEXT("File Name Length exceeds maximum."), TEXT("NotesApp"), MB_OK | MB_ICONSTOP);
                            return 0;
                        }

                    TCHAR szText[MAX_FILENAME_LENGTH];

                    //---- zero a buffer before using it
                    memset( szText, '\0', sizeof(szText)/sizeof(szText[0]) );

                    int iStringLength = GetWindowText(hwndPlayEditBox, szText, sizeof(szText)/sizeof(szText[0]));
                    if(0 == iStringLength)
                        {
                             // control has no text
                            MessageBox(hwnd, TEXT("Edit Box returned no text. No WAV file to play"), TEXT("NotesApp"), MB_OK | MB_ICONSTOP);
                            return 0;
                        }

                    // Disable the button so you can't press play again until we are done playing the file
                    EnableWindow(hwndPlayButton, false);

                    // Send message to the window
                    SendMessage(hwnd, WM_PLAY_WAVEFILE, iStringLength, (LPARAM)szText);
              }

              else if(LOWORD(wParam) == RECORD_BUTTON_ID && HIWORD(wParam) == BN_CLICKED  )
              {
                  // Record Wave button was clicked

                  // read the file name from the edit box and send the info in the WM_RECORD_WAVEFILE message
                    int iTextLength = GetWindowTextLength(hwndRecordEditBox);
                    if(0 == iTextLength)
                        {
                            // control has no text
                            MessageBox(hwnd, TEXT("Edit Box has no text. No WAV file to play."), TEXT("NotesApp"), MB_OK | MB_ICONSTOP);
                            return 0;
                        }
                    else if(MAX_FILENAME_LENGTH < iTextLength)
                        {
                             // filename exceeds max length of filename
                            MessageBox(hwnd, TEXT("File Name Length exceeds maximum."), TEXT("NotesApp"), MB_OK | MB_ICONSTOP);
                            return 0;
                        }

                    TCHAR szText[MAX_FILENAME_LENGTH];

                    //---- zero a buffer before using it
                    memset( szText, '\0', sizeof(szText)/sizeof(szText[0]) );

                    int iStringLength = GetWindowText(hwndRecordEditBox, szText, sizeof(szText)/sizeof(szText[0]));
                    if(0 == iStringLength)
                        {
                             // control has no text
                            MessageBox(hwnd, TEXT("Edit Box returned no text. No WAV file to play"), TEXT("NotesApp"), MB_OK | MB_ICONSTOP);
                            return 0;
                        }

                    // Disable the button so you can't press record again until we are done playing the file
                    EnableWindow(hwndRecordButton, false);

                    // Send message to the window
                    SendMessage(hwnd, WM_RECORD_WAVEFILE, iStringLength, (LPARAM)szText);
                }

              else if(LOWORD(wParam) == RECORD_STOP_BUTTON_ID && HIWORD(wParam) == BN_CLICKED)
              {
                    // Stop Recording Button was clicked.
                    SendMessage(hwnd, WM_RECORD_STOP, NULL, NULL);
              }

              else if(LOWORD(wParam) == PLAY_STOP_BUTTON_ID && HIWORD(wParam) == BN_CLICKED)
              {
                    // Stop Playing Button was clicked.
                    SendMessage(hwnd, WM_PLAY_STOP, NULL, NULL);
              }

               else if(LOWORD(wParam) == RECORD_PAUSE_BUTTON_ID && HIWORD(wParam) == BN_CLICKED)
              {
                    // Pause Recording Button was clicked.
                    SendMessage(hwnd, WM_RECORD_PAUSE, NULL, NULL);
              }

              else if(LOWORD(wParam) == PLAY_PAUSE_BUTTON_ID && HIWORD(wParam) == BN_CLICKED)
              {
                    // Pause Playing Button was clicked.
                    SendMessage(hwnd, WM_PLAY_PAUSE, NULL, NULL);
              }


              return 0;
              break;
        case WM_RECORD_WAVEFILE:
              // Record to wavefile

             // Record to the given filename
             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);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人8x视频一区二区 | 欧美一区二区三区精品| 777亚洲妇女| 蜜臀av一区二区| 欧美成人激情免费网| 免费成人在线视频观看| 欧美一级久久久久久久大片| 偷偷要91色婷婷| 国产无人区一区二区三区| 风间由美中文字幕在线看视频国产欧美 | 亚洲在线免费播放| 91在线无精精品入口| 亚洲一区二区美女| 欧美精品一二三| 久久er99精品| 亚洲欧美偷拍三级| 欧美一区二区国产| 精品在线播放免费| 亚洲日本在线天堂| 日韩精品综合一本久道在线视频| 久久成人免费网| 精品一区二区免费在线观看| 18涩涩午夜精品.www| 91传媒视频在线播放| 免费在线观看不卡| 自拍偷在线精品自拍偷无码专区| 欧美巨大另类极品videosbest | 国产精品区一区二区三| 91精品国产欧美一区二区成人| 成人免费视频caoporn| 亚洲二区在线观看| 国产精品欧美极品| 精品国产污污免费网站入口| 91黄色免费版| yourporn久久国产精品| 国产伦精品一区二区三区免费迷| 亚洲午夜电影在线观看| 国产精品传媒在线| 国产精品免费aⅴ片在线观看| 91精品国产综合久久小美女| 99久久99久久精品免费观看| 国产东北露脸精品视频| 五月激情丁香一区二区三区| 亚洲一区二区三区四区在线免费观看 | 亚洲一区在线观看视频| 国产女主播视频一区二区| 欧美一区二区大片| 日韩欧美亚洲一区二区| 91精品国产色综合久久ai换脸 | 国产精品一区二区91| 精品在线免费观看| 国内外精品视频| 国产精品白丝jk黑袜喷水| 国产在线麻豆精品观看| 风流少妇一区二区| 91在线免费播放| 国产喷白浆一区二区三区| 国产精品国产三级国产三级人妇| 国产精品乱人伦中文| 亚洲美女视频在线| 日本成人超碰在线观看| 国产精品一区二区三区网站| 91麻豆免费观看| 日韩欧美在线影院| 国产精品午夜在线观看| 亚洲尤物在线视频观看| 蜜桃av一区二区| 91理论电影在线观看| 欧美一区二区三区电影| 国产精品久久久久影院老司| 亚洲一区二区三区激情| 福利视频网站一区二区三区| 欧美精品色综合| 久久精品日产第一区二区三区高清版| 亚洲欧美日韩国产综合在线| 美女诱惑一区二区| 成人精品一区二区三区中文字幕| 欧美私人免费视频| 综合中文字幕亚洲| 成人黄色大片在线观看| 国产日韩欧美在线一区| 久久99国产精品久久99果冻传媒| 在线欧美一区二区| 一区在线观看免费| 不卡的电影网站| 国产女主播视频一区二区| 国产一区在线观看麻豆| 日韩一卡二卡三卡四卡| 免费黄网站欧美| 精品三级在线看| 免费不卡在线观看| 在线不卡a资源高清| 青青草91视频| 欧美www视频| 激情图区综合网| 久久精品亚洲精品国产欧美 | 国产精品一级黄| 久久久久久亚洲综合影院红桃| 毛片基地黄久久久久久天堂| 欧美高清一级片在线| 日韩高清一区二区| 精品成人佐山爱一区二区| 国产伦理精品不卡| 亚洲女人小视频在线观看| 欧美日韩国产高清一区| 色综合久久久久综合99| 国产亚洲午夜高清国产拍精品| av在线播放成人| 国产精一品亚洲二区在线视频| 免费看欧美美女黄的网站| 亚洲午夜激情网页| 日韩欧美在线观看一区二区三区| 精品制服美女丁香| 国产精品久久久久婷婷二区次| www.成人在线| 日韩电影一二三区| 久久蜜桃一区二区| 欧美中文字幕久久| 国产又粗又猛又爽又黄91精品| 一区精品在线播放| 欧美一级日韩免费不卡| 成人免费毛片aaaaa**| 亚洲国产中文字幕| 中文字幕第一区| 日本一区二区免费在线观看视频| 色悠悠亚洲一区二区| 岛国一区二区三区| 国产在线国偷精品产拍免费yy| 麻豆精品一区二区综合av| 一区二区欧美精品| 亚洲私人黄色宅男| 国产精品传媒视频| 国产欧美日韩在线| 国产精品乱码人人做人人爱| 久久久国产精品不卡| 日韩天堂在线观看| 精品国产麻豆免费人成网站| 91精品久久久久久久91蜜桃| 在线播放视频一区| 日韩欧美一级精品久久| 久久综合九色综合久久久精品综合 | 国产美女视频一区| av电影一区二区| 欧美美女网站色| 欧美videossexotv100| 另类小说图片综合网| 欧美高清一级片在线观看| 樱花影视一区二区| 国产不卡在线播放| 婷婷一区二区三区| 偷拍一区二区三区| 亚洲国产精品综合小说图片区| 精品国产乱码久久久久久1区2区| 欧美一级理论性理论a| 中文在线资源观看网站视频免费不卡| 中文字幕一区二区三区在线观看| 亚洲va韩国va欧美va精品| 国产一区二区三区精品视频| 91国偷自产一区二区三区观看| 精品欧美一区二区三区精品久久| 亚洲成人一区二区| 亚洲品质自拍视频网站| 亚洲影院理伦片| 亚洲成人av一区二区| 亚洲男人天堂av| 国产精品国产三级国产aⅴ无密码| 国产精品色眯眯| 亚洲柠檬福利资源导航| 国产精品视频在线看| 欧美国产亚洲另类动漫| 国产精品每日更新| 午夜一区二区三区视频| 国产伦理精品不卡| 欧美午夜精品久久久久久超碰| 欧美伊人精品成人久久综合97 | 精品嫩草影院久久| 欧美国产精品v| 99久久99久久久精品齐齐| 亚洲欧美成aⅴ人在线观看| 国产成人免费视| 精品国产伦一区二区三区观看方式| 国产美女久久久久| 伊人色综合久久天天人手人婷| 日韩欧美视频一区| 成+人+亚洲+综合天堂| 亚洲成人av电影| 国产欧美视频在线观看| 欧美三级韩国三级日本一级| 国产一区中文字幕| 午夜视频在线观看一区二区三区| 久久蜜桃av一区精品变态类天堂| 在线观看免费一区| 成人一区在线观看| 热久久免费视频| 亚洲图片另类小说| 久久久久久久久蜜桃| 欧美日韩不卡在线| 色av成人天堂桃色av| 日本成人在线网站| 亚洲乱码中文字幕综合|