Jump to content

IsMute()


Ontosy
 Share

Recommended Posts

http://www.autoitscript.com/forum/index.ph...mp;hl=audio.au3

I think there's no way to know if the master volume has been set to mute. If it works for you, you could use Volly's Audio.au3 and do something like this:

#include <Audio.au3>
$Vol=_SoundGetMasterVolume()
If $Vol=0 Then MsgBox(0,"","It's mute")

This will only work if your master volume is set to 0, not mute.

Put 'help with audio functions' in the description of your thread so users who know how this works can help better.

Link to comment
Share on other sites

Hi Guys,

Or, the other way around:

I would like to check if audio is muted, If it's not, send {VOLUME_MUTE}, else, leave is as it is.

I'm working on a script that spawns a lot of messages (1 every second), whitch "bongs" the

default Windows sound. This is realy anoying.. so I put a Send("{VOLUME_MUTE}") at

the beginning (whitch should mute audio) and another Send("{VOLUME_MUTE}") at the

end, whitch sould restore the audio to not-muted... unless... the user has already muted

the audio. In that case my script actually ENABLES audio, and mutes back at the end of the script.

Here's wat I would like: at the beginning of the script, I would like to save the current state of muting

(like 0=muted, 1=not muted) and then if $muteState=1, mute the audio.

At the end of the script, restore the mute state saved earlier...

Can anyone help?

Thanx,

Marble127

Holland

Link to comment
Share on other sites

I think you can check the mute status through some strange api calls. i went cross-eyed when I saw them.

Here's a crude way to check if audio is muted:

run("sndvol32","",@SW_HIDE)
winwait("Volume Control")
$mute_query= ControlCommand ("Volume Control","","[TEXT:&Mute all]","IsChecked" )
If $mute_query=1 Then
    msgbox(1,"","Audio is muted.")
Else
    msgbox(1,"","Audio isn't muted.")
EndIf
WinClose("VolumeControl")

Alternatively with _SoundGetMasterVolume(), you can store the current setting, set the volume to 0, then restore the setting when the script is done.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...