home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 February
/
PCWK0297.iso
/
envelop
/
envelop.5
/
Tools
/
Arsenal
/
tools
/
playwav
/
audio.eto
next >
Wrap
Text File
|
1996-07-08
|
994b
|
31 lines
Type AudioPlayer
' call with name of wav file or name of registered windows sound
Dim SND_SYNC As Long 'return after sound played
Dim SND_ASYNC As Long 'return right away, sound plays async
Dim SND_NODEFAULT As Long 'return silently if not found
Dim SND_MEMORY As Long 'file is an in memory image
Dim SND_LOOP As Long 'combine with async, play loop till next call
Dim SND_NOSTOP As Long 'return without playing if player busy
Declare Function sndPlaySoundA Lib "Winmm" (ByVal file as string, ByVal opt as long) as long
Function Play(file As String) As Long
Play = sndPlaySoundA(file, SND_ASYNC Or SND_NODEFAULT)
End Function
Function PlaySync(file As String) As Long
Play = sndPlaySoundA(file, SND_SYNC Or SND_NODEFAULT)
End Function
End Type
Begin Code
AudioPlayer.SND_SYNC = 0
AudioPlayer.SND_ASYNC = 1
AudioPlayer.SND_NODEFAULT = 2
AudioPlayer.SND_MEMORY = 4
AudioPlayer.SND_LOOP = 8
AudioPlayer.SND_NOSTOP = 16
End Code