Sunday, July 31, 2016

Windows: Create Volume Up/Down Shortcut with Sound

Step by step on how to create shortcut for adjusting volume. All shortcuts will produce "Ding" sound for you.

Creating shortcut for adjusting volume is very useful. It is faster than moving the mouse to taskbar to change volume. This page will show you how to create volume shortcut using freeware AutoHotkey script.

1Download AutoHotkey and install.

2Create new *.ank file, and paste this code inside the file
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

Process, Priority, , High

;Ctrl+Left => Volume up
^Left::
Send {Volume_Down 3}
SoundPlay *-1
return

;Ctrl+Right => Volume down
^Right::
Send {Volume_Up 3}
SoundPlay *-1
return

This script will create shortcut which "Ctrl + Left" will lower volume and "Ctrl + Right" will louder volume. All shortcuts will produce "Ding" sound for you.

3Save and close the file. Then, right click of the file and click "Compile Script".

4Executable file (*.exe) will be created. When you want to run this file, always run as administrator to make your shortcut active when running other programs.

5Once the program is active on taskbar. You can try press shortcut "Ctrl + Left"/"Ctrl + Right" to adjust the volume. All shortcuts will produce "Ding" sound for you.

Tip: If you want to run this app on startup. There are 2 ways to do it: Copy program into startup folder (described here), or create schedule task to run the program when logon (described here). Don't forget to set running mode as administrator.


Happy Coding!

No comments:

Post a Comment