API in .NET

mciSendString

Following the same guideline of the PlaySound API in .NET:
The Long in VB6 code must be converted to an Integer.
mciSendString, the API that plays WAV, MID, or MP3. The VB6 declaration is:
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, _
ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
And then, according to our conversion guideline, the VB.NET declaration would be:
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, _
ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
And then, you can use it just like in VB6.

Usage examples:
'Load file into mciSendString.
mciSendString("OPEN C:\Pocahontas.mid TYPE SEQUENCER ALIAS makeoneup", String.Empty, 0, 0)

'Play file.
mciSendString("PLAY makeoneup", String.Empty, 0, 0)

'Play file from the beginning.
mciSendString("PLAY makeoneup FROM 0", String.Empty, 0, 0)

'Stop file.
mciSendString("STOP makeoneup", String.Empty, 0, 0)

'Load WAVE file into mciSendString.
mciSendString("OPEN C:\freeze.wav TYPE WAVEAUDIO ALIAS makeoneup", String.Empty, 0, 0)

'Load MP3 file into mciSendString.
mciSendString("OPEN C:\winds.mp3 TYPE MPEGVIDEO ALIAS makeoneup", String.Empty, 0, 0)