Wednesday, November 1, 2017

PTT - Push To Talk

When was the last time you were looking for the unmute button in Webex and it took you more than two seconds to find it?

When was the last time you thought you are on mute but actually everyone can hear you snore?

I spend a lot of time in conference calls. This mute thing happens to me a lot.

PTT stands for Push To Talk like we used in walkie-talkies. The computer mic would be normally muted and as long as I press the PTT button, it will unmute the mic.

I couldn't find any such off the shelf device, so I decided to create one on my own.

To do so I had to integrate few components. Here is the flow of things:

When I press a button on my special device, it will send the key combination of "PrintScreen+F11". Then a special program called AutoHotKey will intercept that key combination and execute an application I wrote that controls the computer mic.

The PTT button


I am using an Arduino like microcontroller called Teensy LC. I value my time and my money, and there is nothing better than the Teensy line of microcontrollers which are very powerful, Arduino IDE based, excellent support and superb software quality.

I decided to use two buttons, as sometimes I am the star of the meeting and I don't want to keep pressing the PTT button all the time. The "toggle button" will flip the default mic state.

I also added a LED to show red when unmuted and green when muted.


AutoHotKey

AutoHotKey is a program that can run macros when a key is pressed. I use it to capture the keyboard signals from the button device and run the MuteMe.exe program.

Here is the code:






MuteMe.exe


I don't know how to write a program to mute, but Computer Cabal knows, and I shamelessly used his code.

I had to do some modifications:
  1. I found no need to mute and unmute before actually muting or unmuting. each and every time I run the program. I think he/she had a specific problem with their setup. It works on my laptop without.
  2. I added a method to detect what the current mic status is.
  3. I change the main program to accept a parameter. If its "0" then mute, if it is "1" then unmute.
Here is the code


CoreAudioMicMute.cs:



WindowsMicMute.cs:
MuteMe.cs: