Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
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-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated