|
-
Jun 12th, 2000, 09:51 AM
#1
Thread Starter
Lively Member
how are you able to play sounds? (code) how can you stop sounds while playing? Can you load them into a file(hopefully .res)?
thanks in advance!
-
Jun 12th, 2000, 10:00 AM
#2
Try Something Like this
Option Explicit
'
Private Declare Function PlaySound Lib "winmm.dll" Alias _
"PlaySoundA" (ByVal IpszName as String, ByVal hModule As _
Long, ByVal dwFlags As Long) As Long
'
Private Const SND_FILENAME = &H20000 ' name is a filename
Private Const SND_AYSNC = &H1 ' play asynchronously
Private Const SND_SYNC = &H0
'
Private Sub PlayASound()
PlaySound App.Path & "\JamesBrown.wav",0,SND_SYNC
End Sub
Hope it helps...of course you could always BEEP
-
Jun 13th, 2000, 03:46 AM
#3
Thread Starter
Lively Member
could you clarify what all of that does....?
-
Jun 13th, 2000, 03:53 AM
#4
Frenzied Member
Read all about it...
Check out this sister site for info on API's (this link will take you to the function described above):
http://www.vbapi.com/ref/p/playsound.html
-
Jun 13th, 2000, 04:02 AM
#5
Or use the sndPlaySound API.
Code for module.
Code:
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Code to play sound.
Code:
Call sndPlaySound("C:\MySound.wav", &H1)
And, yes you can add them to a RES file.
-
Jun 13th, 2000, 05:33 AM
#6
Ok it plays wav files
All it does it replays .wav files. We have a whole series of sound bits etc which play during different events, we use this call to play them. Doesn't do anything else, just plays wav files...though will try out Megs API call.
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
|