Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.


Windows Mobile 6.5
A version of this page is also available for

This function prepares a waveform data block for playback. This function allows both the audio driver and the operating system (OS) to do time consuming processing of the header and/or buffer once at initialization. The application can use the buffer repeatedly without additional processing by the driver or the OS.

MMRESULT waveOutPrepareHeader(
  HWAVEOUT hwo, 
  UINT cbwh 


Handle to the waveform-audio output device.


Pointer to a WAVEHDR structure that identifies the data block to be prepared. The buffer's base address must be aligned with the respect to the sample size.


Size, in bytes, of the WAVEHDR structure.

One of the values described in the following table is returned.

Value Description




Specified device handle is invalid.


The buffer's base address is not aligned with the sample size.


No device driver is present.


Unable to allocate or lock memory.

The lpData, dwBufferLength, and dwFlags members of the WAVEHDR structure must be set before calling this function (dwFlags must be zero).

Once prepared, the application may not change the lpData field.

Preparing a header that has already been prepared has no effect, and the function returns zero.

An application should not attempt to prepare the same header on two different wave devices at the same time. If you want to record from one wave device and play back the same data to another wave device, but don't want to copy data between buffers, you can allocate two wave headers, point them both to the same data buffer, and then call waveInPrepareHeader on one and waveOutPrepareHeader on the other as appropriate.

Windows Embedded CEWindows CE 2.0 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions

© 2015 Microsoft