waveInAddBuffer

Syntax

WORD waveInAddBuffer(hWaveIn, lpWaveInHdr, wSize)

This function sends an input buffer to a waveform input device. When the buffer is filled, it is sent back to the application.

Parameters

HWAVEIN hWaveIn

Specifies a handle to the waveform input device.

LPWAVEHDR lpWaveInHdr

Specifies a far pointer to a WAVEHDR structure that identifies the buffer.

WORD wSize

Specifies the size of the WAVEHDR structure.

Return Value

Returns zero if the function was successful. Otherwise, it returns an error number. Possible error returns are:

MMSYSERR_INVALHANDLE

Specified device handle is invalid.

WAVERR_UNPREPARED

lpWaveInHdr hasn't been prepared.

Comments

The data buffer must be prepared with waveInPrepareHeader before it is passed to waveInAddBuffer. The WAVEHDR data structure and the data buffer pointed to by its lpData field must be allocated with GlobalAlloc using the GMEM_MOVEABLE and GMEM_SHARE flags, and locked with GlobalLock.

See Also

waveInPrepareHeader