Click to See Complete Forum and Search --> : How can i play a WAV file in VB?
maxcode
June 13th, 2001, 01:04 PM
Please Help!@
http://www.maxcode.com/images/s2source.gifhttp://www.maxcode.com/images/s2tut.gifhttp://www.maxcode.com/images/s2doc.gifhttp://www.maxcode.com/images/s2com.gif
All At http://www.maxcode.com/
------------------------------------
Clemens Timmermans (17-Year old)
-------------------------------------
- 'The Matrix has you, NEO' -(quote from: the Matrix)
Iouri
June 13th, 2001, 01:21 PM
Use the MCI control. Set it's Wait property to False before executing the
Play command. The program continues executing while the file plays.
' Open the device and play the sound.
private Sub cmdPlay_Click()
' Disable this button.
cmdPlay.Enabled = false
' set the file name.
MMControl1.FileName = txtFilename.Text
' Open the MCI device.
MMControl1.Wait = true
MMControl1.Command = "Open"
' Play the sound without waiting.
MMControl1.Notify = true
MMControl1.Wait = false
MMControl1.Command = "Play"
' Enable the timer.
tmrSound.Enabled = true
cmdStop.Enabled = true
End Sub
The MCI control's Done event fires when the control has finished playing
the WAV file.
' Close the device when the sound is done.
private Sub MMControl1_Done(NotifyCode as Integer)
' Close the device.
MMControl1.Command = "Close"
' Disable the timer.
tmrSound.Enabled = false
cmdStop.Enabled = false
' Reenable the button.
cmdPlay.Enabled = true
End Sub
Iouri Boutchkine
iouri@hotsheet.com
Cimperiali
June 15th, 2001, 11:04 AM
...Or was not it a way to tell us your site is back??
;)
Cheers,
Cesare
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
maxcode
June 15th, 2001, 11:06 AM
both :)
http://www.maxcode.com/images/s2source.gifhttp://www.maxcode.com/images/s2tut.gifhttp://www.maxcode.com/images/s2doc.gifhttp://www.maxcode.com/images/s2com.gif
All At http://www.maxcode.com/
------------------------------------
Clemens Timmermans (17-Year old)
-------------------------------------
- 'The Matrix has you, NEO' -(quote from: the Matrix)
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.