Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I play a WAV file?
Message
 
 
To
02/01/1997 04:12:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00016309
Message ID:
00016361
Views:
31
>I wanted to play a "click" sound, or rather a click WAV file whenever the user clicks on a certain button. I know I've got to do it within the Click event but how do I play a WAV file?
>
>Ben
I spent an hour with Micosoft foxpro people and he faxed me the code necessary to play WAV files as follows:
SET LIBRARY TO SYS(2004)+"FOXTOOLS.FLL"
MREGISTER=REGFN("SndPlaySound","CI","I","mmsystem)
MWAVE="chimes.wav"
MFLAG=1
MCALL=CALL=CALLFN(MREGISTER,MWAVE,MFLAG)

The program will search the current directory, the Windows Program directory, then the Windows system directory looking for the WAV
file. MFLAG=1 plays the sound asynchronously with your program, and =0 stops the program until the sound is finished. There are other options if you are interested.
Previous
Reply
Map
View

Click here to load this message in the networking platform