1
Post New Requests Here / Re: Audio output device manager
« on: February 07, 2009, 05:55 PM »
@Nod5,
I have been trawling the interweb for a while now to find exactly this kind of fix, I thought I should at the very least say this works on my XP SP2 system and I'm going to attempt the same thing on Windows 7 Build 7000, just for kicks.
Come to think of it, one way to improve both scripts would be to somehow bypass the need to setup device name(s) manually in the script...
edit2:
Ok, I just put this together. Works fine on my XP system but note that it relies on the fact that my audio device names are listed in the registry at the last location noted above. It would be great if someone could quickly check if that registry location lists audio device names on his/her PC too.#SingleInstance force
AutoTrim, Off
;________GET AUDIO DEVICE NAMES INTO ARRAY________________
xcount = 1
Loop, HKEY_CURRENT_USER , Software\Microsoft\Windows\CurrentVersion\Applets\Volume Control,2,0
{
if A_LoopRegName = Options ;ignore subkey "Options"
continue
dev%xcount% = %A_LoopRegName% ;put audio device name in array
xcount += 1
}
xcount -= 1
;________GET CURRENT AUDIO DEVICE NAME____________________
RegRead, x, HKEY_CURRENT_USER, Software\Microsoft\Multimedia\Sound Mapper, Playback
;________LOOP OVER ARRAY. IF MATCH, SWITCH TO NEXT________
Loop, %xcount%
{
if dev%A_index% != %x% ;not match current device?
continue
xc := A_index + 1
if xc > %xcount%
xc = 1
xnew := dev%xc% ;name of new device
RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Microsoft\Multimedia\Sound Mapper, Playback, %xnew%
TrayTip, ,%xnew%, 2,
break
}
sleep 2000-Nod5 (April 24, 2007, 07:28 AM)
I have been trawling the interweb for a while now to find exactly this kind of fix, I thought I should at the very least say this works on my XP SP2 system and I'm going to attempt the same thing on Windows 7 Build 7000, just for kicks.