waveOutClose

  MMRESULT waveOutClose(hWaveOut)    
  HWAVEOUT hWaveOut;    

The waveOutClose function closes the specified waveform output device.

Parameters

hWaveOut

Specifies a handle to the waveform output device. If the function is successful, the handle is no longer valid after this call.

Return Value

Returns zero if the function was successful. Otherwise, it returns an error number. Possible error returns are:

Value Meaning

MMSYSERR_INVALHANDLE Specified device handle is invalid.
WAVERR_STILLPLAYING There are still buffers in the queue.
MMSYSERR_HANDLEBUSY The handle hWaveOut is in use on another thread.

Comments

If the device is still playing a waveform, the close operation will fail. Use waveOutReset to terminate waveform playback before calling waveOutClose.

See Also

waveOutOpen, waveOutReset