topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday April 25, 2024, 4:46 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - elchabacupra [ switch to compact view ]

Pages: [1]
1
Post New Requests Here / Re: Audio output device manager
« on: February 07, 2009, 05:55 PM »
@Nod5,



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

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.

Pages: [1]