|
|
Title | Play a WAV file by using an MMC control |
Keywords | sound, WAV, WaveAudio, MMC |
Categories | Multimedia, 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
|
|
|
|
|
|