Hi guys!
Does any1 know a script (run in background all the time) that auto unmute a specific program upon launching this program?
Many thanks!
Auto unmute a specific program upon launching this program
-
- Posts: 8
- Joined: 01 May 2024, 18:52
-
- Posts: 8
- Joined: 01 May 2024, 18:52
Re: Auto unmute a specific program upon launching this program
Can any1 help me pls?
Re: Auto unmute a specific program upon launching this program
It’s very specific to the program, and you haven’t provided any details. How do you manually unmute it? Is there a keyboard shortcut?
-
- Posts: 8
- Joined: 01 May 2024, 18:52
Re: Auto unmute a specific program upon launching this program
Hi! Thanks for the help
So there is no keyboard shortcut required. I think about a script that has Programlist: A.exe, B.exe ... And with this script runs in background, whenever program A or B starts, immediately unmute that program and thats it!
Appreciate your time!
Re: Auto unmute a specific program upon launching this program
No, you’re not understanding what I’m saying. I’m not saying the script would create a shortcut. I’m asking you to describe how you manually unmute the program(s) so that the script can mimic those actions, such as sending whatever keyboard shortcut that program may have built in for muting and unmuting. You have given us no info with which we can help you.
-
- Posts: 8
- Joined: 01 May 2024, 18:52
Re: Auto unmute a specific program upon launching this program
got it!boiler wrote: ↑04 May 2024, 03:47No, you’re not understanding what I’m saying. I’m not saying the script would create a shortcut. I’m asking you to describe how you manually unmute the program(s) so that the script can mimic those actions, such as sending whatever keyboard shortcut that program may have built in for muting and unmuting. You have given us no info with which we can help you.
I mute the program using this ahk https://github.com/TomiBelan/mute-on-focus-lost
Using this ahk, I don't know why the next time I start any program, it just auto mutes so Im thinking of another ahk to unmute to make it perfect!
Re: Auto unmute a specific program upon launching this program
From what I see, that script doesn’t mute a specific program, but it turns the master volume for your computer to zero, muting everything. It may be triggered by a certain program’s window losing focus, but at first glance, it looks like it’s not doing anything to mute only that program. Is that right?
Re: Auto unmute a specific program upon launching this program
If you want to unmute specific windows when they're activated and mute them when they're deactivated, you can try my script, WinExeCommander. Create events for active windows and call these functions. You'll need Nircmd and changing the path accordingly.
Code: Select all
Mute_Unmute_Created(mEvent) => Run('D:\Programmes\Nircmd\nircmd.exe muteappvolume ' mEvent['processName'] ' 0')
Mute_Unmute_Terminated(mEvent) => Run('D:\Programmes\Nircmd\nircmd.exe muteappvolume ' mEvent['processName'] ' 1')
-
- Posts: 8
- Joined: 01 May 2024, 18:52
Re: Auto unmute a specific program upon launching this program
Yes you are right, and I noticed a bug that many programs affected by that script, the next time I boot it up, the sound just mute on default so I need to find a nother script to unmute that programboiler wrote: ↑04 May 2024, 05:00From what I see, that script doesn’t mute a specific program, but it turns the master volume for your computer to zero, muting everything. It may be triggered by a certain program’s window losing focus, but at first glance, it looks like it’s not doing anything to mute only that program. Is that right?
-
- Posts: 8
- Joined: 01 May 2024, 18:52
Re: Auto unmute a specific program upon launching this program
Thanks for the help bro!XMCQCX wrote: ↑04 May 2024, 05:59If you want to unmute specific windows when they're activated and mute them when they're deactivated, you can try my script, WinExeCommander. Create events for active windows and call these functions. You'll need Nircmd and changing the path accordingly.
Code: Select all
Mute_Unmute_Created(mEvent) => Run('D:\Programmes\Nircmd\nircmd.exe muteappvolume ' mEvent['processName'] ' 0') Mute_Unmute_Terminated(mEvent) => Run('D:\Programmes\Nircmd\nircmd.exe muteappvolume ' mEvent['processName'] ' 1')
Can I add multiple processname to it and how will the code be like?
-
- Posts: 8
- Joined: 01 May 2024, 18:52
Re: Auto unmute a specific program upon launching this program
Code: Select all
Mute_Unmute_Created(mEvent) {
if WinExist('ff7remake_ ' mEvent['ff7remake_'])
Run('H:\Playnite\Console\Mute on Focus\nircmd.exe muteappvolume ' mEvent['ff7remake_'] ' 0')
}
I tried this but it didnt unmute Ff7 upon launching. Am I missing something?
[Mod edit: Added [code][/code] tags. Please use them yourself when posting code!]
Re: Auto unmute a specific program upon launching this program
@WilliamLeGod
Like that.
Make sure the function name associated with the event is "Mute_Unmute". Can you make the "Calculator_AlwaysOnTop" example function properly?
Like that.
Code: Select all
Mute_Unmute_Created(mEvent) {
Run('H:\Playnite\Console\Mute on Focus\nircmd.exe muteappvolume ' mEvent['processName'] ' 0')
}
-
- Posts: 8
- Joined: 01 May 2024, 18:52
Re: Auto unmute a specific program upon launching this program
I just tested Calculator script but it didn't work.
Re: Auto unmute a specific program upon launching this program
@WilliamLeGod
1- Delete everything from "WinExeCommander.ahk", paste this and save:
2- Delete everything from "Settings.json", paste this and save:
3- Reload the script if it's currently running. If it's not running, double-click on WinExeCommander.ahk to launch it.
4- Open the Calculator app.
If it doesn't work, you can try other methods suggested in this tutorial to detect window open and close.
1- Delete everything from "WinExeCommander.ahk", paste this and save:
Code: Select all
#Requires AutoHotkey v2.0
#SingleInstance
#Include '.\Lib\WinExeCmd.ahk'
Calculator_AlwaysOnTop_Created(mEvent) {
if WinExist('ahk_id ' mEvent['id'])
WinSetAlwaysOnTop(1, 'ahk_id ' mEvent['id'])
else
WinExeCmd.MsgBox('Calculator does not exist.', 'WinExeCommander', 'iconx')
}
;==============================================
Unmute_Created(mEvent) {
Run('H:\Playnite\Console\Mute on Focus\nircmd.exe muteappvolume ' mEvent['processName'] ' 0')
}
Code: Select all
{
"mEvents":{
"Calculator_AlwaysOnTop":{
"critical":0,
"function":"Calculator_AlwaysOnTop",
"log":0,
"mode":"2",
"monitoring":"winEvent",
"notifInfo":0,
"notifStatus":1,
"period":"1000",
"soundCreated":"- None -",
"soundTerminated":"- None -",
"state":1,
"window":{
"detectHiddenWindows":0,
"processName":"ApplicationFrameHost.exe",
"processPath":"C:\\Windows\\System32\\ApplicationFrameHost.exe",
"winActive":0,
"winClass":"ApplicationFrameWindow",
"winMinMax":"",
"winTitle":"Calculator",
"winTitleMatchMode":"2"
}
},
"ff7remake_Unmute":{
"critical":0,
"function":"Unmute",
"log":0,
"mode":"2",
"monitoring":"winEvent",
"notifInfo":0,
"notifStatus":1,
"period":"1000",
"soundCreated":"- None -",
"soundTerminated":"- None -",
"state":1,
"window":{
"detectHiddenWindows":0,
"processName":"ff7remake_.exe",
"processPath":"",
"winActive":0,
"winClass":"",
"winMinMax":"",
"winTitle":"",
"winTitleMatchMode":"2"
}
}
},
"mUser":{
"alwaysOnTop":0,
"critical":0,
"delayDeviceChange":1250,
"delayWinEvent":1000,
"detectHiddenWindows":0,
"dwFlagsWinEvent":"0x0",
"log":0,
"mWinEventsStates":{
"EVENT_SYSTEM_ALERT":0,
"EVENT_SYSTEM_CAPTUREEND":1,
"EVENT_SYSTEM_CAPTURESTART":1,
"EVENT_SYSTEM_CONTEXTHELPEND":0,
"EVENT_SYSTEM_CONTEXTHELPSTART":0,
"EVENT_SYSTEM_DIALOGEND":1,
"EVENT_SYSTEM_DIALOGSTART":1,
"EVENT_SYSTEM_DRAGDROPEND":0,
"EVENT_SYSTEM_DRAGDROPSTART":0,
"EVENT_SYSTEM_FOREGROUND":1,
"EVENT_SYSTEM_MENUEND":0,
"EVENT_SYSTEM_MENUPOPUPEND":0,
"EVENT_SYSTEM_MENUPOPUPSTART":0,
"EVENT_SYSTEM_MENUSTART":0,
"EVENT_SYSTEM_MINIMIZEEND":1,
"EVENT_SYSTEM_MINIMIZESTART":1,
"EVENT_SYSTEM_MOVESIZEEND":0,
"EVENT_SYSTEM_MOVESIZESTART":0,
"EVENT_SYSTEM_SCROLLINGEND":0,
"EVENT_SYSTEM_SCROLLINGSTART":0,
"EVENT_SYSTEM_SOUND":0,
"EVENT_SYSTEM_SWITCHEND":1,
"EVENT_SYSTEM_SWITCHSTART":1
},
"modeDevice":2,
"modeProcess":2,
"modeWindow":2,
"monitoringDevice":"deviceChange",
"monitoringProcess":"wmi",
"monitoringWindow":"winEvent",
"notifInfo":1,
"notifProfileMatch":1,
"notifProfileStart":1,
"notifStatus":1,
"periodTimerDevice":1500,
"periodTimerProcess":1500,
"periodTimerWindow":1500,
"periodWMIprocess":1250,
"profileLoadEvent":0,
"soundCreated":"- None -",
"soundProfile":"- None -",
"soundTerminated":"- None -",
"state":0,
"themeName":"Reptilian",
"trayIconLeftClick":"- None -",
"trayIconLeftDClick":"Open Events Manager",
"trayMenuIconSize":20,
"winActive":0,
"winEventPreset":3,
"winMinMax":"",
"winTitleMatchMode":2
}
}
4- Open the Calculator app.
If it doesn't work, you can try other methods suggested in this tutorial to detect window open and close.