The WAVEHDR structure defines the header used to identify a waveform data buffer.
typedef struct wavehdr_tag {
LPSTR lpData;
DWORD dwBufferLength;
DWORD dwBytesRecorded;
DWORD dwUser;
DWORD dwFlags;
DWORD dwLoops;
struct wavehdr_tag far * lpNext;
DWORD reserved;
} WAVEHDR;
The WAVEHDR structure has the following fields:
lpData
Specifies a far pointer to the waveform data buffer.
dwBufferLength
Specifies the length of the data buffer.
dwBytesRecorded
When the header is used in input, this specifies how much data is in the buffer.
dwUser
Specifies 32 bits of user data.
dwFlags
Specifies flags giving information about the data buffer.
WHDR_DONE
Set by the device driver to indicate that it is finished with the data buffer and is returning it to the application.
WHDR_BEGINLOOP
Specifies that this buffer is the first buffer in a loop. This flag is only used with output data buffers.
WHDR_ENDLOOP
Specifies that this buffer is the last buffer in a loop. This flag is only used with output data buffers.
WHDR_PREPARED
Set by Windows to indicate that the data buffer has been prepared with waveInPrepareHeader or waveOutPrepareHeader.
dwLoops
Specifies the number of times to play the loop. This parameter is used only with output data buffers.
lpNext
Is reserved and should not be used.
reserved
Is reserved and should not be used.
Use the WHDR_BEGINLOOP and WHDR_ENDLOOP flags in the dwFlags field to specify the beginning and ending data blocks for looping. To loop on a single block, specify both flags for the same block. Use the dwLoops field in the WAVEHDR structure for the first block in the loop to specify the number of times to play the loop.