|
-
Dec 15th, 1999, 10:34 PM
#1
Thread Starter
Addicted Member
I want to play a wav file in VB, it is a short file, I want it to be repeated several times in a loop so that it sounds continuous.
Can anyone help me ?
-
Dec 15th, 1999, 10:40 PM
#2
Sure thing!
Code:
Option Explicit
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Const SND_ASYNC = &H1
Private Const SND_LOOP = &H8
Private Const SND_NODEFAULT = &H2
Private Sub cmdStart_Click()
sndPlaySound "C:\WINNT\Media\ding.wav", SND_ASYNC Or SND_LOOP
End Sub
Private Sub cmdStop_Click()
sndPlaySound "C:\WINNT\Media\ding.wav", 0
End Sub
As you can see, I'm using 2 command buttons: cmdStart and cmdStop. Also, just substitue the file name with the appropriate one.
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
[This message has been edited by Serge (edited 12-16-1999).]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|