Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

embed sound in vb

Status
Not open for further replies.

vintl

Technical User
Jun 9, 2000
72
0
0
MY
I want to know how can i embed sound into my progam. the sound will triggered when an event occur, such as in a graph, when the bar reach 100 point, the sound will be triggered.
thanks
 
There are two types of embedding a sound in your application, the first one is by using API function and the other one is using OLE.

Try this....
Public Declare Function sndPlaySoundA lib "winmm.dll" (ByVal lpszSoundName as String, ByVal uFlags as Long) as Long


Private Sub Form_load()
Dim RetVal as Long

RetVal = sndPlaySoundA("c:\windows\media\chimes.wav", SND_ASYNC)

End Sub

or

Put an OLE Object and embed the sound and the code goes like this....

Private Sub Form_load()
OLE1.DoVerb
End Sub

See its simple... enjoy[thumbsup2]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top