Mic Push-to-talk With AutoHotkey and SoundVolumeView

This is an AutoHotkey script I set up to use with NirSoft’s SoundVolumeView.

It uses the command-line from that to send mute/ unmute the microphone (through the system) whenever a key is held down. It’s not perfect and there is a small delay, so improvements are definitely welcome. Anyways, here it is:

#SingleInstance, force
#NoEnv
SendMode Input
#persistent

{
    ToolTip, Starting now...
    RunWait, PowerShell "SoundVolumeView.exe /Mute 'Realtek(R) Audio\Device\Microphone\Capture'",, hide
    SoundBeep, 200, 1000
    launched := false
    ToolTip, You should be muted
    Sleep, 1000
    ToolTip
    return
}

`::
{
    if(not launched) {
        RunWait, PowerShell "SoundVolumeView.exe /Unmute 'Realtek(R) Audio\Device\Microphone\Capture'",, hide
        SoundBeep, 442
        ToolTip, YOU ARE UNMUTED
        launched := true
    }
    return
}

` Up::
{
    RunWait, PowerShell "SoundVolumeView.exe /Mute 'Realtek(R) Audio\Device\Microphone\Capture'",, hide
    SoundBeep, 200
    launched := false
    ToolTip
    return
}


F1::
{
    RunWait, PowerShell "SoundVolumeView.exe /Unmute 'Realtek(R) Audio\Device\Microphone\Capture'",, hide
    SoundBeep, 442, 1000
    ToolTip, Unmuting and exiting
    Sleep, 1000
    Tooltip
    ExitApp
}


Subscribe

Emails are sent about once a month instead of per post. Of course, I won't send you spam, and you can unsubscribe at any time. Otherwise, you can also subscribe via Atom or RSS, Telegram, or Mastodon.

If you enjoyed reading this post, please consider supporting me 💜