Jump to content
Sign in to follow this  

master sound state (on/off)?

Recommended Posts


hello autoit-Users,

can you help me with a little problem.

i toggle the master sound with

, but how i find the state (is the volume off or on!)?

thx for help


Share this post

Link to post
Share on other sites

Func _WaveVolGet()
    Local $WaveVol = -1, $p, $ret
    $p = DllStructCreate ("dword")
    If @error Then
        Return -1
    $ret = DllCall("winmm.dll", "long", "waveOutGetVolume", "long", -1, "long", DllStructGetPtr ($p))
    If ($ret[0] == $MMSYSERR_NOERROR) Then
        $WaveVol = Round(Dec(StringRight(Hex(DllStructGetData ($p, 1), 8), 4)) / 0xFFFF * 100)
    DllStructDelete ($p)
    Return $WaveVol
EndFunc  ;==>_WaveVolGet

Try this, thanks to gafrost :whistle:. I THINK it should return 0 if the sound is muted but I can't test it, sorry.


Try here for a slightly updated version of the function ;) > http://www.autoitscript.com/forum/index.ph...p;hl=sound+mute

Edited by Burrup


Share this post

Link to post
Share on other sites

SciTE for AutoItDirections for Submitting Standard UDFs


Don't argue with an idiot; people watching may not be able to tell the difference.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.