There are occasions when you need to play a sound in your VB application, and often times the default beep just doesn't cut it.
The good news is that it only requires a simple API call to have your VB program play a WAV file. This can come in handy in
a number of situations: a quick musical intro during your initial loading screen, a sound to notify when a process has completed, and
in my case, to use as a rudimentary Soundboard for the office.
The first thing you need to do is declare the API that is going to be used. Put this declaration at the top of the form code:
Now all you have to do is make a call to the API, pass in the full path to the WAV File, and the Hex Value &H1 as the second parameter:
Related Links: Get Audio Durations
Want to discuss this article, or other development issues? Visit our
message boards!
Or contact us directly with a comment or question on this article: click here ! |