Also wenn ich das Projekt starte kommt da so nen Fehler (siehe Bilder)
Und dann geht halt nichts mehr. Könnte aber auch an diesem Code liegen :
Delphi-Quellcode:
procedure waveInProc(hwi: HWAVEIN; uMsg: UINT; dwInstance, dwParam1, dwParam2 : DWord); stdcall;
var
classinstance: TWaveIn absolute dwInstance;
pwh:TWaveHdr;
begin
if umsg = WIM_DATA then
begin
pwh:=PWaveHdr(dwParam1)^;
with classinstance do
begin
fWaveData[pwh.dwUser].Stream.Write(fWaveData[pwh.dwUser].Data, fWaveData[pwh.dwUser].header.dwBytesRecorded);
if fWaveData[pwh.dwUser].Header.dwFlags and MHDR_DONE = MHDR_DONE then
begin
fWaveData[pwh.dwUser].Stream.Position := 0;
if Assigned(fOnData) then
fOnData(fWaveData[pwh.dwUser].Stream);
fWaveData[pwh.dwUser].Stream.Clear;
end;
// fWaveData[pwh.dwUser].Header.lpData := fWaveData[pwh.dwUser].Data;
fWaveData[pwh.dwUser].Header.dwBufferLength := cWaveBufferSize;
fWaveData[pwh.dwUser].Header.dwFlags := 0;
fWaveData[pwh.dwUser].Header.dwBytesRecorded := 0;
waveInPrepareHeader(fHandle, @fWaveData[pwh.dwUser].Header, SizeOf(fWaveData[pwh.dwUser].data));
waveInAddBuffer(fHandle, @fWaveData[pwh.dwUser].Header, SizeOf(fWaveData[pwh.dwUser].data));
end;
end;
end;