earnest ma's site

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
}

Tags: #autohotkey #scripting

Comments

You may view or reply if you have an account anywhere in the Fediverse.

Recent posts from blogs I read Generated by openring

2021-04-19 Emacs news

Upcoming events: Emacs APAC (virtual, in English) https://emacs-apac.gitlab.io/ Sat Apr 24 0130 Vancouver / 0330 Chicago / 0430 Toronto / 0830 GMT / 1030 Berlin / 1400 Kolkata / 1630 Singapore Emacs Berlin (virtual, in English) https://emacs-berlin.org/ Wed Ap…

via Sacha Chua April 19, 2021

Misinformation about Permissions Policy and FLoC

This post was written in a hurry in response to some misinformation about Google’s newest Web antifeature, Federated Learning of Cohorts (FLoC). Google’s FLoC is an attempt to track users even when their browsers (rightly) block third-party cookies. The i…

via Posts on Seirdy's Home April 16, 2021

Modus themes 1.3.0 for GNU Emacs

Information about the latest version of my highly accessible themes for GNU Emacs.

via Protesilaos Stavrou: Master feed with all updates April 17, 2021