waveOutProc callback function

The waveOutProc function is the callback function used with the waveform-audio output device. The waveOutProc function is a placeholder for the application-defined function name. The address of this function can be specified in the callback-address parameter of the waveOutOpen function.


void CALLBACK waveOutProc(
   HWAVEOUT  hwo,
   UINT      uMsg,
   DWORD_PTR dwInstance,
   DWORD_PTR dwParam1,
   DWORD_PTR dwParam2



Handle to the waveform-audio device associated with the callback.


Waveform-audio output message. It can be one of the following values.

Value Meaning
WOM_CLOSE Sent when the device is closed using the waveOutClose function.
WOM_DONE Sent when the device driver is finished with a data block sent using the waveOutWrite function.
WOM_OPEN Sent when the device is opened using the waveOutOpen function.



User-instance data specified with waveOutOpen.


Message parameter.


Message parameter.

Return value

This function does not return a value.


The meaning of the two message parameters, dwParam1 and dwParam2, depends on the message specified in uMsg. The documentation for each message describes the message parameters.

Applications should not call any system-defined functions from inside a callback function, except for EnterCriticalSection, LeaveCriticalSection, midiOutLongMsg, midiOutShortMsg, OutputDebugString, PostMessage, PostThreadMessage, SetEvent, timeGetSystemTime, timeGetTime, timeKillEvent, and timeSetEvent. Calling other wave functions will cause deadlock.


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]


Mmsystem.h (include Windows.h)

See also

Waveform Audio
Waveform Functions