In "old basic" there was the PLAY command that allowed the program to make a sound other than BEEP. Is there a similar function in VB? Better yet, is there an easy way to play a wav file from a VB program?
You will need to add Microsoft Multimedia Control through your Tools/References. I'm using VisualBasic 4, so I can't tell if this would work in any other version.<br><br>Then add the button to your form and code it accordingly. You will need to know the correct command <b>codes</b> to activate and close out the program.<br><br><br><i>Here's an example from one of my progs...</i><br><br>'Private Sub RunFileName()<br>' With mciControl<br>' .SetFocus<br>' .filename = NameOfFile<br>' .Command = "open"<br>' .Command = "play"<br>' End With<br>'End Sub<br><br><br><i>If the user selected REPEAT in the media player's preferences box, then the following will never be execuited</i>.<br><br><font color=red>***The following code will be initiated <b>AFTER</b> the media player has finished***</font><br>'Private Sub mciControl_Done(NotifyCode As Integer)<br>' mciControl.Command = "Close"<br>'End Sub<br><br><br>Just to let you know...The forum you should post a query in is the VisualBasic forum. See Forum list, select programmers, then langauges, and find Visual Basic.<br><br>Hope this gets you started on the right foot... Let us know if this is of any help. Good luck! <p> <br><a href=mailto: > </a><br><a href= > </a><br>You Show me your code, I'll show you mine.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.