Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
API Call to ring system bell/play .WAV?
Message
From
28/08/1999 23:07:09
Scott Butts
Ims Specialty Services
Twin Falls, Idaho, United States
 
 
To
28/08/1999 02:36:20
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00258772
Message ID:
00258895
Views:
22
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
Map
View

Click here to load this message in the networking platform