Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Play a sound
Message
 
To
19/04/2009 09:43:34
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
01395438
Message ID:
01395672
Views:
72
Try This,,,
Make sure the wav file exist in the directory of your application

SET BELL TO "smchimeup2.wav"
? CHR(7)
SET BELL TO


****************************
Declare Integer waveOutSetVolume In WinMM.Dll ;
integer hwo, Integer dwVolume
Declare Integer waveOutGetVolume In WinMM.Dll ;
integer hwo, Integer @dwVolume

* Set current volume level to 1/4 on both channels
SetVolume(Int(0xFFFF*1/4),Int(0xFFFF*1/4))
? "Current volume", GetVolume()


Function SetVolume
Lparameters tnLeftChannel, tnRightChannel
* Set current volume level to tnLeftChannel, tnRightChannel values
waveOutSetVolume(0,Eval('0x'+;
Right(Trans(m.tnLeftChannel,'@0'),4)+;
Right(Trans(m.tnRightChannel,'@0'),4)) )

Function GetVolume
* Get current volume level as hex
Local liVolume
liVolume = 0
waveOutGetVolume(0,@liVolume)
*!* lnLeft = Eval('0x'+Substr(Trans(liVolume,'@0'),7,4))
*!* lnRight = Eval('0x'+Substr(Trans(liVolume,'@0'),3,4))
Return '0x'+Substr(Trans(liVolume,'@0'),7,4)+Substr(Trans(liVolume,'@0'),3,4)


HTH
Ron Seidl
Independent Developer
VFP

"I'm playing in life's theater in anticipation of a great cast party!"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform