This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires AutoHotkey v2 | |
SoundGetDefaultDeviceIndex(desc := 'playback') { | |
; based on this post in the AutoHotkey discord | |
; https://discord.com/channels/115993023636176902/1175025590936543283/1175136154132156526 | |
; and this line in the AutoHotkey source code | |
; https://github.com/AutoHotkey/AutoHotkey/blob/59f219a111a34b21529c7acf5026e11650a06fbc/source/lib/sound.cpp#L96 | |
static CLSID_MMDeviceEnumerator := "{BCDE0395-E52F-467C-8E3D-C4579291692E}" | |
, IID_IMMDeviceEnumerator := "{A95664D2-9614-4F35-A746-DE8DB63617E6}" | |
, S_OK := 0 | |
, VT_UNKNOWN := 0xD |