Jump to content
Sign in to follow this  
Painkiller

Changing Sound Card for Voice

Recommended Posts

Painkiller

I looked through some other posts and found that a guy was changing his sound card for Audio. Well i have two cards for voice input. I use one for sound overs (it loops the in feed so i can play sound effects in games and cool stuff like that and yes that part of the program is done and over with some time ago). The other sound card handles my actual voice. The problem is, i cant change between the cards in game, so i decided to try and make a registry changer that allows me to change the voice options for the sound cards (like change from card A to card B for input). The Output will remain the same, however the input must change to the desired card.

So far i have come up with: (by other posts that i have read)

HotKeySet("^s","change")
HotKeySet("^q","term")

$card1 = "Realtek HD Audio input"
$card2 = "Microsoft LifeCam VX-3000."
$current = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper","ConsoleVoiceComRecord")

While 1
    Sleep(30)
WEnd


Func term()
    Exit(1)
EndFunc

Func change()
    if $current = $card1 Then
        $current = $card2
        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper","Record","REG_SZ",$card2)
        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper","ConsoleVoiceComRecord","REG_SZ",$card2)
    Else
        $current = $card1
        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper","Record","REG_SZ",$card1)
        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper","ConsoleVoiceComRecord","REG_SZ",$card1)
    EndIf
    $currentCard = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper","Record")
    $currentCard2 = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper","ConsoleVoiceComRecord")
    MsgBox(64,"Soundcard","The currently used Soundcard is: "& $currentCard & " : " & $currentCard2)
EndFunc

Now this code changes the registry strings to the proper sound cards. As you can see i am using a Realtek and a Microsoft Cam for my inputs. The problem is, once the registry values are changed, nothing happens (and I'm assuming thats due to the computer needs restarted for the new values to take place). But i know in windows xp(thats what this is for), you can go into "Sounds and Audio Devices" and change between the two without restarting the computer. Is there some sort of .dll i must call and wait for? I read a post about changing the wallpaper and having to run a .dll file to by-pass a restart, is that possible in my case too? I obviously need the changes to take effect without restart and without any dialogs showing up as this will be running while a game is running, but for test purposes i am only testing using the sound recorder that windows provides! Any help is greatly appreciated and thanks in advance for any advice given!

Share this post


Link to post
Share on other sites
KaFu

Take a look at my program SSD. You wrote "I know in Windows XP", that makes me assume you're running either Vista or Win7, which both don't allow switching of output any other way then manual (no api disclosed). I think what's true for output is also true for input. I guess you can use the SSD logic, hiding the control panel as it pops up.

Share this post


Link to post
Share on other sites
Painkiller

Take a look at my program SSD. You wrote "I know in Windows XP", that makes me assume you're running either Vista or Win7, which both don't allow switching of output any other way then manual (no api disclosed). I think what's true for output is also true for input. I guess you can use the SSD logic, hiding the control panel as it pops up.

Thanks but i am running windows XP. This program is not intended for vista or windows 7 but merely for XP only! "But i know in windows xp(thats what this is for)"

Edited by Painkiller

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×