General information
Category:
Windows API functions
Here is a little code I got pointed to from here, hope this helps.
#DEFINE SND_SYNC 0x00
#DEFINE SND_ASYNC 0x01
#DEFINE SND_NODEFAULT 0x02
#DEFINE SND_LOOP 0x08
#DEFINE SND_STOP 0x0f
#DEFINE SND_NOSTOP 0x10
PARAMETERS lptype,csndfile
IF EMPTY(lptype)
lptype = "NOSTOP"
*!* lptype = "ASYNCLOOP"
*!* lptype = "STOP"
ELSE
lptype = ALLTRIM(UPPER(lptype))
ENDIF
IF EMPTY(csndfile)
csndfile = "C:\WINDOWS\MEDIA\The Microsoft Sound.wav"
*!* csndfile = "C:\WINDOWS\MEDIA\DING.WAV"
ENDIF
DECLARE INTEGER sndPlaySound IN winmm.DLL STRING cSoundName, INTEGER uFlags
DO CASE
CASE lptype == "SYNC"
sndPlaySound( csndfile, SND_SYNC )
CASE lptype == "ASYNC"
sndPlaySound( csndfile, SND_ASYNC )
CASE lptype == "NOSTOP"
sndPlaySound( csndfile, SND_NOSTOP )
CASE lptype == "STOP"
sndPlaySound( csndfile, SND_STOP )
CASE lptype == "ASYNCLOOP"
sndPlaySound( csndfile, SND_ASYNC + SND_LOOP)
ENDCASE
RETURN
? sndPlaySound( x, 16 ) && delay till finished
? "I don't execute until the sound is done"
x = "C:\WINDOWS\MEDIA\DING.WAV"
*!* * this program plays a sound for 10 seconds
*!* #define SND_SYNC 0x00
*!* #define SND_ASYNC 0x01
*!* #define SND_NODEFAULT 0x02
*!* #define SND_LOOP 0x08
*!* #define SND_NOSTOP 0x10
*!* declare integer sndPlaySound in winmm.dll string cSoundName, integer uFlags
*!* =sndPlaySound( "c:\windows\media\ctmelody.wav", SND_ASYNC + SND_LOOP )
*!* =INKEY(10)
*!* * you could put some usefull processing in here instead!
*!* =sndPlaySound( .NULL. , SND_NODEFAULT)
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only