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.
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist