Skip to content

Instantly share code, notes, and snippets.

Created January 5, 2017 01:08
Show Gist options
  • Save anonymous/8ad0fe08ab240450a30b7d4e02372781 to your computer and use it in GitHub Desktop.
Save anonymous/8ad0fe08ab240450a30b7d4e02372781 to your computer and use it in GitHub Desktop.
Hotkey, F8, EarlyTerm ; Quick kill command. Hit PAUSE key at any time on the keyboard to kill the script
Loop ;This is the loop. When you run this script, AHK will set the volume at desired level then wait .5 seconds then will repeat forever until you press the PAUSE key, which will kill the script.
{
SoundSet, 100, MASTER, VOLUME, 3
Sleep, 200
}
; SoundSet = AHK Command; MASTER = ComponentType; VOLUME = ControlType (This is the volume you are setting the mic at); 6 = DeviceNumber ; DeviceNumber will vary from system to system. Please run the soundcard analysis script to find out what the DeviceNumber of your microphone is. This script can be found in the AHK help here: https://autohotkey.com/docs/commands/SoundSet.htm#Ex . The soundcard analysis script is not very descriptive, so a good way to glean the information you require is to set the volume of the mic you are interested to something wierd, like 57, from within the Windows recording devices Properties interface. Then, run the soundcard analysis script and look for the entry with the Setting column matching the volume you set. Note the number in the Mixer column. This number = DeviceNumber in this script. Substitute your DeviceNumber in this script. Then, test it out by opening the Recording Devices mixer in Windows, clicking the properties of your mic then running the script and watching it change to the script defined volume. If you manually change the volume from the properties interface, you will see your script change it back every .5 seconds. If you hit the PAUSE key, the script will be killed and now your manual adjustments will not be altered by the script anymore.
; Sleep, VARIABLE is the amount of time in miliseconds the script will wait before looping again and setting the volume. I have it set for every .5 seconds.
EarlyTerm: ;Step to end this script
ExitApp ;Ends hotkey application and removes it from the tool tray
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment