Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitlePlay a WAV file by using an MMC control
Keywordssound, WAV, WaveAudio, MMC
CategoriesMultimedia, Controls
 
Use the control's Command method to make it open, play, and close the file.
 
Private Sub Form_Load()
    ' Prepare the MCI control for WaveAudio.
    MMControl1.Notify = False
    MMControl1.Wait = True
    MMControl1.Shareable = False
    MMControl1.DeviceType = "WaveAudio"
End Sub

' Open the device and play the sound.
Private Sub cmdPlay_Click()
    ' Set the file name.
    MMControl1.FileName = txtFile.Text

    ' Open the MCI device.
    MMControl1.Wait = True
    MMControl1.Command = "Open"

    ' Play the sound.
    MMControl1.Wait = True
    MMControl1.Command = "Play"

    ' Close the device.
    MMControl1.Command = "Close"
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated