HydrogenAudio

Digital Audio/Video => General A/V => Topic started by: mellotron on 2007-05-04 15:03:50

Title: A shortcut to changing the default sound playback card?
Post by: mellotron on 2007-05-04 15:03:50
So I have 2 soundcards, one onboard that I use for my speakers and my SB Live with kxdriver running my headphones. Now the DSP I've configured for the SB Live is optimized for my headphones so I'd like to keep the speakers and headphones on separate cards. Now sometimes I switch between my headphones and speakers, usually when I have people over or I have some ear strain and currently its a 3-step process to change the playback source. I'm wondering if there's a shortcut, *.bat script or registry entry I could use to streamline the process. I'm running WinXP, btw.
Title: A shortcut to changing the default sound playback card?
Post by: mellotron on 2007-05-04 19:25:35
well i figured it out. If anyone else is curious this is how I did it;

I exported the registry settings from HKCU->Software->Microsoft->Multimedia->Sound Mapper for both states (on board and sblive sound cards) and labeled them KXAUDIO.REG and NVAUDIO.REG then I whipped up a batch file:

Code: [Select]
@ECHO OFF
:BEGIN
CLS
IF EXIST TEST.TXT (GOTO KXA) ELSE (GOTO NVA)
:KXA
ECHO HEADPHONES ARE NOW IN EFFECT!
REGEDIT /S KXAUDIO.REG
DEL TEST.TXT
GOTO END
:NVA
ECHO SPEAKERS ARE NOW IN EFFECT!
REGEDIT /S NVAUDIO.REG
ECHO SUCCESS > TEST.TXT
GOTO END
:END


The method is a bit crude but it works. Basically it looks for a text file and depending on whether it exists or not it loads up the keys from one of the .REG files. After it loads the .REG file it either deletes or creates the text file, so the next time I launch the batch file it will load up the other .REG file.

Finally I placed a shortcut to the batch file on my quick launch bar so now I'm only 1 click away from toggling sound sources instead of having to go through the control panel -> multimedia -> audio devices -> audio -> playback. Real convenience 
SimplePortal 1.0.0 RC1 © 2008-2021