Создаю программу для записи с микрофона средствами DirectSound. При включении в свойствах описания буфера захвата эффект подавления акустического эха получаю ошибку:
HRESULT: 0x800401f0 (2147746288)
Name: CO_E_NOTINITIALIZED
Description: CoInitialize has not been called.
Severity code: Failed
Facility Code: FACILITY_ITF (4)
Error Code: 0x01f0 (496)
var
FDSCB :iDirectSoundCaptureBuffer;
FDSC :IDirectSoundCapture8;
FDSCBDesc :TDSCBUFFERDESC;
begin
...
FResult:=DirectSoundCaptureCreate8(FGUID,FDSC,nil);
if FResult<>DS_OK then
Begin
...
end;
ZeroMemory(@dsEffect[0],sizeof(TDSCEffectDesc));
dsEffect[0].dwSize := sizeof(TDSCEffectDesc);
dsEffect[0].dwFlags := DSCFX_LOCSOFTWARE;
dsEffect[0].guidDSCFXClass := GUID_DSCFX_CLASS_AEC;
dsEffect[0].guidDSCFXInstance:=GUID_DSCFX_SYSTEM_AEC;
dsEffect[0].dwReserved1:=0;
dsEffect[0].dwReserved2:=0;
ZeroMemory(@dsEffect[1],sizeof(TDSCEffectDesc));
dsEffect[1].dwSize := sizeof(TDSCEffectDesc);
dsEffect[1].dwFlags := DSCFX_LOCSOFTWARE;
dsEffect[1].guidDSCFXClass := GUID_DSCFX_CLASS_NS;
dsEffect[1].guidDSCFXInstance:=GUID_DSCFX_SYSTEM_NS;
dsEffect[1].dwReserved1:=0;
dsEffect[1].dwReserved2:=0;
with FDSCBDesc do
Begin
dwSize:=sizeof(TDSCBUFFERDESC);
dwFlags:=DSCBCAPS_CTRLFX;
dwBufferBytes:=notifysize*notifycount;
lpwfxFormat:=FFormat;
dwFXCount:=2;
dwReserved:=0;
lpDSCFXDesc:=@dsEffect;
End;
FResult:=FDSC.CreateCaptureBuffer(FDSCBDesc,FDSCB,nil);
if FResult<>DS_OK then
Begin
end;
Где тут что не так может быть?