Playing a music file at runtime
Posted on 2002-07-03
I have written a small program in VB6 which is a clock that at runtime at a time previouysly entered will display a message box. This part works OK
I would like the second part of the program to play a sound such as from a CD or off the hard drive etc - This is my problem. I have written the following code:
Private Sub Timer1_Timer()
Label1.Caption = Time
CurrentTime = Format(Time, "hh:mm:ss")
If CurrentTime = Text1.Text Then
Beep ' Sound a tone.
MsgBox (Text2.Text), , "Alarm Clock Reminder"
Timer1.Enabled = False
Form1.WindowState = 0 'Restore form to original size
I was able to make the speaker sound a 'beep' but cannot make it play a music file. Any help much appreciated.