B
biechangjiang
Unregistered / Unconfirmed
GUEST, unregistred user!
pSDC : IDirectSoundCapture;
pDSCB : IDirectSoundCaptureBuffer;
wfex: TWaveFormatEx;
dscbd: DSCBUFFERDESC;
hr:= DirectSoundCaptureCreate(nil,pSDC,nil);
if not SUCCEEDED(hr) then
begin
ShowMessage('DirectSoundCaptureCreate error');
end;
ZeroMemory(@wfex,sizeof(TWaveFormatEx));
wfex.wFormatTag :=WAVE_FORMAT_PCM;
wfex.nChannels:=1;
wfex.nSamplesPerSec:=16000;
wfex.nAvgBytesPerSec:=32000;
wfex.nBlockAlign:=2;
wfex.wBitsPerSample:=16;
wfex.cbSize:=0;
dscbd.dwSize:=sizeof(DSCBUFFERDESC);
dscbd.dwFlags:=1;
dscbd.dwBufferBytes:=wfex.nAvgBytesPerSec;
dscbd.dwReserved:=1;
dscbd.lpwfxFormat:= @wfex;
hr:= pSDC.CreateCaptureBuffer(dscbd,pDSCB,nil);
if not SUCCEEDED(hr) then
begin
ShowMessage('error');
exit;
end;
为什么总是错误呀!!这让我怎么向下写呀!!服了
pDSCB : IDirectSoundCaptureBuffer;
wfex: TWaveFormatEx;
dscbd: DSCBUFFERDESC;
hr:= DirectSoundCaptureCreate(nil,pSDC,nil);
if not SUCCEEDED(hr) then
begin
ShowMessage('DirectSoundCaptureCreate error');
end;
ZeroMemory(@wfex,sizeof(TWaveFormatEx));
wfex.wFormatTag :=WAVE_FORMAT_PCM;
wfex.nChannels:=1;
wfex.nSamplesPerSec:=16000;
wfex.nAvgBytesPerSec:=32000;
wfex.nBlockAlign:=2;
wfex.wBitsPerSample:=16;
wfex.cbSize:=0;
dscbd.dwSize:=sizeof(DSCBUFFERDESC);
dscbd.dwFlags:=1;
dscbd.dwBufferBytes:=wfex.nAvgBytesPerSec;
dscbd.dwReserved:=1;
dscbd.lpwfxFormat:= @wfex;
hr:= pSDC.CreateCaptureBuffer(dscbd,pDSCB,nil);
if not SUCCEEDED(hr) then
begin
ShowMessage('error');
exit;
end;
为什么总是错误呀!!这让我怎么向下写呀!!服了