devxlogo

Playing WAV Files

Playing WAV Files

Question:
How can I play WAV or MID files through Visual Basic?

Answer:
Use the MSMCI.VBX, provided with VB/Win Pro 3.0. You can also declare and call the MM-functions manually:

Declare Function mciExecute Lib “MMSystem” (ByVal FileName as String) As Integer Sub Form1_Click ()   iResult = mciExecute(“Play c:windowsmkmyday.wav”)End Sub
VB4.0 (at least, the Enterprise edition) comes with two OCX’s, MCI16.OCX and MCI32.OCX with the same functionality.

devx-admin

Share the Post: