Jump to content

Unmute AutoIt application

Recommended Posts

I am working on monitoring utility for a medical application. The AutoIt application needs to produce an audible alarm on a standard PC.  Using a combination of Sound.au3 , _AudioEndpointVolume.au3 and SoundSetWaveVolume()  I can set the volume level and play my alarm sound. However, the end-user can still Mute my specific application ZollLaunch. I haven't found a way to programmatically unmute it, see the image. This screenshot is from Windows 7 the same issue exists in Windows 10.


Does anyone know of how to unmute a specific application in AutoIt without automating the GUI or using NirSoft's SoundVolumeView. I don't feel automating the GUI or running the Nirsoft utility will provide a robust enough solution.

Between the following two posts Mute Microphone and _AudioEndPointVolume  it would seem to be possible but above my skill level.

The vendor-supplied utility doesn't do anything with volume controls making it far to easy for the end-user to mute the sound and all future alarms. Just one of the issues I am addressing by writing my own utility.

Any help much appreciated.

Share this post

Link to post
Share on other sites

Thanks for the reply Werty.

The keyboard function VOLUME_MUTE only works on the master mute, if the individual program mute is activated it will not unmute the channel. Also, Send("{VOLUME_MUTE}") toggles the mute state it does not leave it in a defined state. My application requires that the sound is playing with a great deal of certainty. Therefore, in addition, I was not comfortable using GUI interactions.

Share this post

Link to post
Share on other sites

Ahh, sorry about that.

As a work around until you get it solved you could make your script make BEEP......BEEP......BEEP.... sounds every 2-5 seconds, if the BEEP's stop something is wrong :D

You said it's for medical monitoring and such places always have machines standing there making constant BEEP sounds, atleast it is so in movies and tv-series :D

Though i would guess it could be rather annoying ;)


Some guy's script + some other guy's script = my script!

Share this post

Link to post
Share on other sites

There's a great script by @Danyfirex here, enumerating through the apps playing sounds ("sessions").

 Also there seems to be an interface called ISimpleAudioVolume with which you can get and set the sessions mute state. Sadly I couldn't get it to work, here's what I got so far for info.

; https://docs.microsoft.com/en-us/windows/win32/coreaudio/endpointvolume-api
Local $pISimpleAudioVolume = 0
$oIAudioSessionManager2.GetSimpleAudioVolume($pIAudioSessionControl2, False, $pISimpleAudioVolume)
ConsoleWrite("$pISimpleAudioVolume=" & $pISimpleAudioVolume & @CRLF)

Global Const $sIID_ISimpleAudioVolume = "{87CE5498-68D6-44E5-9215-6DA47EF883D8}"
Global Const $sTagISimpleAudioVolume = "GetMasterVolume hresult(float); GetMute hresult(ptr);SetMasterVolume hresult(float;ptr*);SetMute hresult(ptr;ptr*);"
Local $oISimpleAudioVolume = 0

$oISimpleAudioVolume = ObjCreateInterface($pISimpleAudioVolume, $sIID_ISimpleAudioVolume, $sTagISimpleAudioVolume)
ConsoleWrite("$oISimpleAudioVolume=" & IsObj($oISimpleAudioVolume) & @CRLF)

Local $pbMute = 0
Local $iVolume = 0
ConsoleWrite("$oISimpleAudioVolume.GetMasterVolume=" & $oISimpleAudioVolume.GetMasterVolume($iVolume) & @CRLF)
ConsoleWrite("$oISimpleAudioVolume.GetMute=" & $oISimpleAudioVolume.GetMute($pbMute) & @CRLF)


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

  • Create New...