MCI_windows编程实现实例(3)

发布时间:2021-06-06

MCI_windows编程实现实例

b.

{ 录音示例 =

HWND hwnd;

MCI_OPEN_PARMS mciopen;

MCI_RECORD_PARMS mci1;

MCI_SAVE_PARMS mcisave;

DWORD rtrn;

char b[80];

hwndGetActiveWindow()->m_hWnd;

rtrn = mciSendCommand(0,MCI_OPEN,MCI_OPEN_TYPE|MCI_OPEN_ELEMENT, (DWORD)(LPVOID)&mciopen); if(rtrn != 0){

mciGetErrorString(rtrn,(LPSTR)b,80);

::MessageBox(hwnd,b,"MCI ERROR!",MB_OK);

} = wDeviceID = mciopen.wDeviceID;

mci1.dwCallback = (DWORD)hwnd; rtrn = mciSendCommand(wDeviceID,MCI_RECORD,MCI_NOTIFY,(DWORD)(LPVOID)&mci1); if (rtrn != 0L){ mciopen.lpstrElementName = "e:\\ding.wav"; mcisave.lpfilename = "e:\\ding.wav"; mciopen.lpstrDeviceType = "waveaudio";

mciGetErrorString(rtrn,(LPSTR)b,80);

::MessageBox(hwnd,b,"MCI Error",MB_OK);

mciSendCommand(wDeviceID,MCI_CLOSE,0,NULL);

}

}

//保存到文件并停止录音

{

HWND hwnd;

MCI_SAVE_PARMS mcisave;

MCI_OPEN_PARMS mciopen;

DWORD rtrn;

char b[80];

hwndGetActiveWindow()->m_hWnd;

mcisave.dwCallback = (DWORD)hwnd; mciopen.lpstrElementName = "e:\\ding.wav"; mcisave.lpfilename = "e:\\ding.wav"; mciopen.lpstrDeviceType = "waveaudio";

MCI_windows编程实现实例(3).doc 将本文的Word文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:7 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219