K
k4-1
Unregistered / Unconfirmed
GUEST, unregistred user!
下面这段代码是直接从MSDN中翻译过来的。为什么把这段代码放到button上,却播不出什么。大家帮忙看看好吗,自己是在弄不明白,水平太菜。先谢过了。
var
wDeviceID : UINT;
mciOpenParms : MCI_OPEN_PARMS;
mciPlayParms : MCI_PLAY_PARMS;
begin
mciOpenParms.lpstrDeviceType := 'waveaudio';
mciOpenParms.lpstrElementName := Pchar('d:/temp.wav');
mciSendCommand(0, MCI_OPEN,
MCI_OPEN_TYPE and MCI_OPEN_ELEMENT,
DWORD(@mciOpenParms));
wDeviceID := mciOpenParms.wDeviceID;
mciPlayParms.dwCallback := handle;
mciSendCommand(wDeviceID, MCI_PLAY, MCI_NOTIFY,
DWORD(@mciPlayParms));
end;
var
wDeviceID : UINT;
mciOpenParms : MCI_OPEN_PARMS;
mciPlayParms : MCI_PLAY_PARMS;
begin
mciOpenParms.lpstrDeviceType := 'waveaudio';
mciOpenParms.lpstrElementName := Pchar('d:/temp.wav');
mciSendCommand(0, MCI_OPEN,
MCI_OPEN_TYPE and MCI_OPEN_ELEMENT,
DWORD(@mciOpenParms));
wDeviceID := mciOpenParms.wDeviceID;
mciPlayParms.dwCallback := handle;
mciSendCommand(wDeviceID, MCI_PLAY, MCI_NOTIFY,
DWORD(@mciPlayParms));
end;