Ontosy Posted October 31, 2007 Posted October 31, 2007 Do it is possibile a function to test if sound volume is mute or not?
Nahuel Posted October 31, 2007 Posted October 31, 2007 http://www.autoitscript.com/forum/index.ph...mp;hl=audio.au3I 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.
Ontosy Posted October 31, 2007 Author Posted October 31, 2007 Ty, it is good; but i would to knows the volume status after use of Send("{VOLUME_MUTE}")
marble127 Posted November 6, 2007 Posted November 6, 2007 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}") atthe beginning (whitch should mute audio) and another Send("{VOLUME_MUTE}") at theend, whitch sould restore the audio to not-muted... unless... the user has already mutedthe 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,Marble127Holland
TurionAltec Posted November 6, 2007 Posted November 6, 2007 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now