Jump to content

Soundcard changer


Recommended Posts

I have 2 Soundcard for my Pc...one onboard and the other one is my headset. but sometimes i ant to hear with my speakers and manullay switching bores me.

So it would be nice if you could help me..here the code(very easy)

I only want to change the soundoutput

$card1 =;first soundcart(Realtek)
$card2 =;second soundcart(Logitech)
$current =;the cart wich is currently used

If $current = $card1 Then
;set $card2 the current one
ElseIf $current = $card2 Then
;set $card1 the current one
EndIf

MsgBox(64,"Soundcard","The currently used Soundcard is: "& $current)
Edited by Arterie
Link to comment
Share on other sites

Ok solved this on my own. If some one is interested in this script:

$card1 = "Realtek AC97 Audio"
$card2 = "Logitech USB Headset"
$current = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper","Playback")

If $current = $card1 Then
    RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper","Playback","REG_SZ",$card2)
ElseIf $current = $card2 Then
    RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper","Playback","REG_SZ",$card1)
EndIf

$current = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper","Playback")
MsgBox(64,"Soundcard","The currently used Soundcard is: "& $current)
Edited by Arterie
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...