- Код: Выделить всё
Set DXS = DX8.DirectSoundCreate(vbNullString)
DXS.SetCooperativeLevel frmMain.hWnd, DSSCL_WRITEPRIMARY
With bufferDesc
With .fxFormat
'.lExtra - не знаю чё это
.lSamplesPerSec = IIf(InStr(1, Format, "44") > 0, 44100, IIf(InStr(1, Format, "22") > 0, 22050, 11025))
.nBitsPerSample = IIf(InStr(1, Format, "16") > 0, 16, 8)
.nChannels = IIf(InStr(1, Format, "стерео") > 0, 2, 1)
.nFormatTag = WAVE_FORMAT_PCM
.nSize = 0 'может не ноль, тада как посчитать?
.nBlockAlign = .nBitsPerSample / 8 * .nChannels
.lAvgBytesPerSec = .lSamplesPerSec * .nBlockAlign
End With
'.guid3DAlgorithm - это для чего?
.lBufferBytes = .fxFormat.lAvgBytesPerSec * 5
.lFlags = DSBCAPS_CTRLFREQUENCY Or DSBCAPS_CTRLPAN Or DSBCAPS_CTRLVOLUME Or DSBCAPS_STATIC
End With
Set DXSB = DXS.CreatePrimarySoundBuffer(bufferDesc)
пишет неверный вызов процедуры или параметр.
для захвата звука пишу тоже самое только .lFlag другой - всё нормально...
ктонить помогите