waveOutOpen (winmm)
Last changed: -117.204.32.52

.
Summary
The waveOutOpen function opens the given waveform-audio output device for playback.

C# Signature:

[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveOutOpen(ref IntPtr hWaveOut, IntPtr uDeviceID, ref WAVEFORMATEX lpFormat, delegateWaveOutProc dwCallback, IntPtr dwInstance, uint dwFlags);

VB Signature:

'Support for WAVEFORMATEX

Declare Function waveOutOpen Lib "winmm.dll" Alias "waveOutOpen" (ByRef phwi As IntPtr, ByVal uDeviceID As IntPtr, ByRef pwfx As WAVEFORMATEX, ByVal dwCallback As IntPtr, ByVal dwCallbackInstance As IntPtr, ByVal fdwOpen As WAVE_FLAGS) As MMSYSERR

'Support for WAVEFORMATEXTENSIBLE

Declare Function waveOutOpen Lib "winmm.dll" Alias "waveOutOpen" (ByRef phwi As IntPtr, ByVal uDeviceID As IntPtr, ByRef pwfx As WAVEFORMATEXTENSIBLE, ByVal dwCallback As IntPtr, ByVal dwCallbackInstance As IntPtr, ByVal fdwOpen As WAVE_FLAGS) As MMSYSERR

User-Defined Types:

Alternative Managed API:

See http://winmm.codeplex.com/

Notes:

See http://social.msdn.microsoft.com/Forums/en-US/windowspro-audiodevelopment/thread/14926e01-635e-4360-998b-ec6124d888a7 - correct C# signature at the bottom (including uDeviceId). This is based on http://msdn.microsoft.com/en-us/library/windows/desktop/dd743866%28v=vs.85%29.aspx which shows a UINT_PTR for that parameter. Note that the _PTR parameters are the only ones that are different sizes in 32 vs. 64 bit mode. In .Net you use IntPtr for that purpose.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Documentation
waveOutOpen on MSDN