Skip to content

Instantly share code, notes, and snippets.

@elibosley
Created June 4, 2019 02:16
Show Gist options
  • Save elibosley/342f0086551c4e1d74beb3de1024cdfc to your computer and use it in GitHub Desktop.
Save elibosley/342f0086551c4e1d74beb3de1024cdfc to your computer and use it in GitHub Desktop.
Soundblaster Omni 5.1 Sound Control With AutoHotKey
#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.
;#InstallKeybdHook
#SingleInstance
#MaxHotkeysPerInterval 1000
VolumeSet(number) {
ComponentTypes = MASTER,HEADPHONES,DIGITAL,LINE,SYNTH,CD,TELEPHONE,PCSPEAKER,WAVE,AUX,ANALOG,N/A\
SoundGet, Setting, SPEAKERS, VOL, 1
SoundGet, Setting2, SPEAKERS, VOL, 2
Setting := Setting + number
Setting2 := Setting2 + number
SoundSet, Setting, MASTER, VOL, 1
SoundSet, Setting2, MASTER, VOL, 2
}
VKAD::Send {Media_Play_Pause}
return
;VKAF::SoundSet, +3
VKAF::VolumeSet(3)
VKAE::VolumeSet(-3)
@elibosley
Copy link
Author

Currently this sets the volume of my speakers and headphones simultaneously, just for consistency and to allow the Omni to work as a univeral volume control. It also overrides the mute functionality in favor of a play-pause button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment