|
-
Jul 17th, 2000, 12:39 AM
#1
Thread Starter
New Member
I'm pretty poor when it comes to VB, so if anyone can give me any (REALLY) basic instructions on how to play a *.wav file after an event occurs, it would be really helpful.
I tried what Dim suggested:
Shell("C:\mywave.wav")
but VB protested with
"Invalid procedure call or arguement"
btw, I am using VB 5.0 Enterprise (not by choice, it's for a school project)
[Edited by SOUL-JAH on 07-17-2000 at 01:43 AM]
-
Jul 17th, 2000, 12:47 AM
#2
Fanatic Member
hehe i knew that woudn't work...here i'm 90% sure this will
Code:
'In Gen Decler.
Private Declare Function Playwave Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Sub Command1_Click()
F = Playwave("C:\abort.wav", 1)
End Sub
gl, D!m
[Edited by Dim on 07-17-2000 at 01:52 AM]
-
Jul 17th, 2000, 12:54 AM
#3
You trying to play a wav file? Refer to this thread: http://forums.vb-world.net/showthrea...threadid=23098
Hope that helps.
-
Jul 17th, 2000, 08:58 AM
#4
Use PlaySound
You should use PlaySound which is the successor to sndPlaySound.
Code:
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Sub Command1_Click()
'Play the WAV
PlaySound "C:\MyFile.wav", 0&, &H1
End Sub
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
|