Jump to content

Per Application Volume Control Using AHK

I recently watched the Linus rant video on Techquickie about application volume control on windows and EarTrumpet and thought that this ahk script that I came across might be useful to someone.

 

(Links to video)

Floatplane:

https://www.floatplane.com/post/Ag5tZzLA7P

 

YouTube:

 

Script:

https://gist.github.com/G33kDude/5b7ba418e685e52c3e6507e5c6972959

 

script required library (needs to be installed in a subfolder "Lib" of the folder that the main script is in or one of the other locations listed  here: AHK library locations):

https://www.autohotkey.com/board/topic/21984-vista-audio-control-functions/

 

I like to listen to music while I play some games but I found alt tabbing out of the game to open the volume mixer incredibly annoying (although EarTrumpet does make it less so) so some time ago I decided I'd have a crack at solving the problem. I ended up trying to do it with Auto Hot Key with decent success and even more success once my friend took a look and vastly improved it. I decided that I should probably share the script online but came across the script above which is much cleaner. I didn't really like the key combos and it also only allowed control of the currently active window so I modified it to change some of the key combos and to allow control of spotify from any window.

 

my fork of the script:

https://gist.github.com/DodgyUSB/0f2cbbc40d8501f8b98ec56bc22474e5

 

It should be fairly easy to modify either of the scripts yourself to have it control your preferred music application (or any application for that matter) or to use different key combos if, for example, you don't have any media control keys on your keyboard.

 

Another thing I should note is that the original scrip is a little old and yes the library has 'Vista' in the name (Windows backwards and forwards compatibility always surprises me) but it still seems to work perfectly in the latest version of Windows 10 but I have no clue about windows 11 compatibility (although it is auto hotkey and should work if AHK works, it uses a number of dll calls for audio control which is at the mercy of Windows however I highly doubt Microsoft are likely to change them anytime soon)

 

I hope someone found this useful

Link to comment
Share on other sites

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

×