Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This structure defines the header used to identify a waveform-audio buffer.

Syntax

typedef struct {
  LPSTR 
lpData;
  DWORD 
dwBufferLength;
  DWORD 
dwBytesRecorded;
  DWORD 
dwUser;
  DWORD 
dwFlags;
  DWORD 
dwLoops;
  struct wavehdr_tag* 
lpNext;
  DWORD 
reserved;}
WAVEHDR;

Members

lpData

Long pointer to the address of the waveform buffer. This buffer must be block-aligned according to the nBlockAlignmember of the WAVEFORMATEXstructure used to open the device.

dwBufferLength

Specifies the length, in bytes, of the buffer.

dwBytesRecorded

When the header is used in input, this member specifies how much data is in the buffer. When the header is used in output, this member specifies the number of bytes played from the buffer.

dwUser

Specifies user data.

dwFlags

Specifies information about the buffer. The following table shows the possible values.

Value Description

WHDR_BEGINLOOP

Set this flag when the buffer should be looped during playback. If you set this flag, you must also set WHDR_ENDLOOP. This flag is used only with output buffers.

WHDR_DONE

Set by the device driver to indicate that it is finished with the buffer and is returning it to the application.

WHDR_ENDLOOP

Set this flag when the buffer should be looped during playback. If you set this flag, you must also set WHDR_BEGINLOOP. This flag is used only with output buffers.

WHDR_INQUEUE

Set by Windows to indicate that the buffer is queued for playback.

WHDR_PREPARED

Set by Windows to indicate that the buffer has been prepared with the waveInPrepareHeaderor waveOutPrepareHeaderfunction.

dwLoops

Specifies the number of times to play the loop. This member is used only with output buffers.

lpNext

Reserved. This member is used within the audio driver to maintain a first-in, first-out linked list of headers awaiting playback.

reserved

Reserved.

Remarks

Use the WHDR_BEGINLOOP and WHDR_ENDLOOP flags in the dwFlagsmember 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 dwLoopsmember in the WAVEHDRstructure for the first block in the loop to specify the number of times to play the loop.

The lpData, dwBufferLength, and dwFlagsmembers must be set before calling the waveInPrepareHeaderor waveOutPrepareHeaderfunction. For either function, the dwFlagsmember must be set to zero.

Requirements

Header mmsystem.h
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also