ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Audio output device manager

<< < (3/4) > >>

superboyac:
Here you go:

calvindienern:
Hi Nod5, tried your second script right out of the box and worked first time! thanks heaps.

I checked the reg settings, my hive has the following:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Volume Control\Logitech USB Headset
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Volume Control\Realtek HD Audio output
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Volume Control\Options

but guessing the Options key is ignored.

Thanks for your help!

edit whoops, didn't see if A_LoopRegName = Options                 ;ignore subkey "Options" in the code
--- End quote ---
. makes sense now

Nod5:
@calvindienern: Great that it works for you. I use the script daily myself.

But even better would be to get something like pulseaudio working so that we can change audio output on the fly, with no application restarts needed (see my failed attempt to get that up and running in this thread: https://www.donationcoder.com/forum/index.php?topic=14100.0 )

elchabacupra:
@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-Nod5 (April 24, 2007, 07:28 AM)
--- End quote ---

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.

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.
-elchabacupra (February 07, 2009, 05:55 PM)
--- End quote ---
Hi and welcome to DC!  :) Great that it works. Let us know how it goes with W7.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version