Partager via


WAVEHDR

A version of this page is also available for

Windows Embedded CE 6.0 R3

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 nBlockAlign member of the WAVEFORMATEX structure 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 waveInPrepareHeader or waveOutPrepareHeader function.

  • 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 dwFlags member 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 member in the WAVEHDR structure for the first block in the loop to specify the number of times to play the loop.

The lpData, dwBufferLength, and dwFlags members must be set before calling the waveInPrepareHeader or waveOutPrepareHeader function. For either function, the dwFlags member 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

Reference

Waveform Audio Structures
WAVEFORMATEX (Waveform Audio)