Jump to content

Help modifying a mute mic script

Recommended Posts

Hello people.

What I am trying to achieve is simply to record my voice from multiple VOIP programs when recording gaming with Fraps. The problem is that whenever I record all mic audio, I hear myself breathing and everything. When I then set it to a certain push-to-talk I miss half my communications. As it looks now I am using both side buttons of my mouse, V, B and numpad 0-9 to communicate. I contacted this guy that made a script for it to work and he sent me the script and what was supposed to be changed.

The problem is that I cannot get it to work and I can't get in touch with him at all. I would really like this to work so I turned here instead! This is his PM back to me containing the information I need.

Hey there, the latest version was lost in my move to japan, but here's the script for a slightly outdated version. I don't have autoit installed to compile it to an exe for you, but that shouldn't be too hard.

There are a couple of lines you'll need to change to suit your particular system, I'll highlight them and explain below. Oh and this only works for Windows 7 as far as I know (maybe vista).

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;~ HotKeySet("{F5}", "DoIt")
HotKeySet("{ESC}", "Quit")
#Include <Misc.au3>
Opt("WinTitleMatchMode", 3)
$but1 = "04" ;Middle Mouse Button
$but2 = "6A" ;* key
$but3 = "91" ;Scroll Lock key
$but4 = "BB" ;= key
$but5 = "42" ;b key
$but6 = "56" ;v key
If Not WinExists("Sound") Then
Run("C:\Windows\System32\control.exe mmsys.cpl,,1")
ControlClick("Sound", "", "","left", 2, 34, 189)
WinWaitActive("Microphone Properties")
ControlCommand("Microphone Properties", "", "SysTabControl321", "TabRight", "")
  ControlCommand("Microphone Properties", "", "SysTabControl321", "TabRight", "")
ControlCommand("Microphone Properties", "", "SysTabControl321", "TabRight", "")
WinSetState("[TITLE:Microphone Properties;]", "", @SW_HIDE)
WinSetState("[TITLE:Sound;]", "", @SW_HIDE)
WinSetState("[TITLE:Microphone Properties;]", "", @SW_HIDE)
WinSetState("[TITLE:Sound;]", "", @SW_HIDE)
$dll = DllOpen("user32.dll")
while 1
While _IsPressed($but1, $dll) _
  Or _IsPressed($but2, $dll) _
  Or _IsPressed($but3, $dll) _
  Or _IsPressed($but4, $dll) _
  Or _IsPressed($but5, $dll) _
  Or _IsPressed($but6, $dll) _
  And ControlCommand("Microphone Properties", "", "Button2", "IsChecked", "") == 1
  ControlCommand("Microphone Properties", "", "Button2", "UnCheck", "")
If Not _IsPressed($but1, $dll) And Not _IsPressed($but2, $dll) And Not _IsPressed($but3, $dll) And Not _IsPressed($but4, $dll) And Not _IsPressed($but5, $dll) And Not _IsPressed($but6, $dll) Then ControlCommand("Microphone Properties", "", "Button2", "Check", "")
Func Quit()
WinSetState("[TITLE:Microphone Properties;]", "", @SW_SHOW)
WinSetState("[TITLE:Sound;]", "", @SW_SHOW)
ControlCommand("Microphone Properties", "", "Button2", "UnCheck", "")

The first set are the buttons you want to use to unmute the microphone. The key codes are here:

  01 Left mouse button
  02 Right mouse button;does not works in my system...
  04 Middle mouse button (three-button mouse)
  05 Windows 2000/XP: X1 mouse button
  06 Windows 2000/XP: X2 mouse button
  08 BACKSPACE key
  09 TAB key
  0C CLEAR key
  0D ENTER key
  10 SHIFT key
  11 CTRL key
  12 ALT key
  13 PAUSE key
  14 CAPS LOCK key
  1B ESC key
  21 PAGE UP key
  22 PAGE DOWN key
  23 END key
  24 HOME key
  25 LEFT ARROW key
  26 UP ARROW key
  27 RIGHT ARROW key
  28 DOWN ARROW key
  29 SELECT key
  2A PRINT key
  2B EXECUTE key
  2D INS key
  2E DEL key
  30 0 key
  31 1 key
  32 2 key
  33 3 key
  34 4 key
  35 5 key
  36 6 key
  37 7 key
  38 8 key
  39 9 key
  41 A key
  42 B key
  43 C key
  44 D key
  45 E key
  46 F key
  47 G key
  48 H key
  49 I key
  4A J key
  4B K key
  4C L key
  4D M key
  4E N key
  4F O key
  50 P key
  51 Q key
  52 R key
  53 S key
  54 T key
  55 U key
  56 V key
  57 W key
  58 X key
  59 Y key
  5A Z key
  5B Left Windows key
  5C Right Windows key
  60 Numeric keypad 0 key
  61 Numeric keypad 1 key
  62 Numeric keypad 2 key
  63 Numeric keypad 3 key
  64 Numeric keypad 4 key
  65 Numeric keypad 5 key
  66 Numeric keypad 6 key
  67 Numeric keypad 7 key
  68 Numeric keypad 8 key
  69 Numeric keypad 9 key
  6A Multiply key
  6B Add key
  6C Separator key
  6D Subtract key
  6E Decimal key
  6F Divide key
  70 F1 key
  71 F2 key
  72 F3 key
  73 F4 key
  74 F5 key
  75 F6 key
  76 F7 key
  77 F8 key
  78 F9 key
  79 F10 key
  7A F11 key
  7B F12 key
  7C-7F F13 key - F16 key
  80H-87H F17 key - F24 key
  90 NUM LOCK key
  91 SCROLL LOCK key
  A0 Left SHIFT key
  A1 Right SHIFT key
  A2 Left CONTROL key
  A3 Right CONTROL key
  A4 Left MENU key
  A5 Right MENU key

The second is the tricky part... it's the control click to open the microphone device you want to mess with. If you install autoit you'll get a windowInfo tool that will show you the coordinates to use, otherwise you can just use trial and error to figure out where to tell it to click. The coordinates are relative to the WINDOW in that call.

Finally you simply put as many tab commands in as it takes your sound device to reach the "Levels" tab, which has the mute command on it. On my old system it had 3 tabs before there, so as you can see my code had 3 tabs in it. My current system only has

| General | Listen | Levels | Microphone Enhancements | Advanced |

So I'd only put two of those tabRight functions in there.

When you edit those 3 things to be the correct stuff, you simply run this script (or compile it to a exe and run that) at any time when you want your microphone muted while recording.

It may seem complicated but it's really not Posted Image

I tried colouring the parts in the code (worked on the other forum) but it doesn't work. They are here:

Part 1:

$but1 = "04" ;Middle Mouse Button
$but2 = "6A" ;* key
$but3 = "91" ;Scroll Lock key
$but4 = "BB" ;= key
$but5 = "42" ;b key
$but6 = "56" ;v key


ControlClick("Sound", "", "","left", 2, 34, 189)


ControlCommand("Microphone Properties", "", "SysTabControl321", "TabRight", "")
  ControlCommand("Microphone Properties", "", "SysTabControl321", "TabRight", "")
ControlCommand("Microphone Properties", "", "SysTabControl321", "TabRight", "")

The first part is not a problem. I just modify that to cover all the keys I am using. I guess I can add more of them as well? $but7 etc? Is X1 mouse button one of the side buttons of the mouse?

The second part is the major problem. I have the windowInfo tool and I drag the crosshair for the coordinates. But which coordiates shall I use? What numbers should I replace? His version has got 3 different numbers but I am only getting two numbers for X/Y.

The third part is no problem as well.

I would really appreciate it if someone could help me out in the right direction! Thanks in advance!

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...