if you are here for the all-in-one, no soldering Microbit version, click here
Mewt allows you to create a hardware button to Mute and Unmute all system microphones with a single press for Windows, Mac and Linux.
Mewt works at the operating system (OS) level, so this will mute/unmute all conferencing software (Zoom, Google Meet, Teams, WebEx, Blue Jeans, GoToMeeting, Skype, Slack, Facebook, Discord, etc.)
Mewt will continuously display the current Mute/Unmute state so you can tell at a glance if your microphone is enabled without having to search for the onscreen icon.
When Mewt detects that your microphone is transmitting audio, it will display a sound visualizer to help you avoid embarassing hot-mic incidents via RGB LED light indicator. Hot mic currently works in Windows, but not yet in Mac or Linux
Muted | Unmuted | Hot Mic |
---|---|---|
Click to expand
Mewt is made up of 2 parts:
- Physical components
- A physical button to control mute state, with a built-in RGB LED to display mute state / hot-mic
- An Arduino microcontroller to interface with the button and the LED. This is also what will communicate with your computer
- Code running on your computer to
Click to expand
Click to expand
Note: these are not referral links, I do not benefit from you clicking on these links. I am not making an endorsement for Amazon or specific 3rd party merchants. These are purely to help people get started
-
Click to expand
Things to consider
- Size: too small makes it hard to press, too big and it takes up desk space.
- Depth: shallower buttons are easier to mount
- LED: you can find buttons without LED lights, with a single colored LED light, with two color LEDs, or even with RGB (Red/Green/Blue) LEDs. Buttons with RGB LEDs allows Mewt to function fully, but they are also often bulkier, pricier and more difficult to wire.
- State: after you press it once, if it stays depressed (On state) and vice versa, it is called a "latching" button. If after you press it, the button resets itself so that you can never tell if it's On or Off by visually looking at it, then it is called a "momentary" button. Mewt works with either.
- Form factor: Mewt can also work as a toggle switch instead of a button
- Common anode vs Common cathode: Mewt works with either. This just affects how you physically connect it to the Arduino.
- Voltage: 3V-6V are best as that is what Arduinos output. I have had no issues with 12V. I don't think Arduinos can drive 120/220V.
- Resistor: Buttons with built-in LEDs typically have resistors already and do not need separate resistors
- SPST/SPDT/DPST/DPDT: Super confusing, right? Here's a link that explains it. TL;DR: get an SPST or SPDT. avoid DPST/DPDT, they're overkill.
Other Examples:
_ Latch Momentary Switch Basic* $3 $3 $3 Deluxe $8 $18 $10* - *buttons without built-in RGB LEDs will require that you separately wire in an RGB for hot-mic, or run modified code for hot-mic to display a blinking LED instead of flashing colors
-
Click to expand
Things to consider
Any Arduino model (Pro Micro, Nano, Uno, etc) should work. Pick the USB connector of your choice (Micro-USB, Mini-USB, UBS-C), Mewt is agnostic.
Things to consider:- Size: Pro Micro is the smallest, followed closely by the Nano. Unos are pretty big
- To solder or not: if you don't want to solder, get an Uno or a Pro Micro/Nano with pre-soldered headers and a breadboard . Headers are the pins that stick out from the Arduino
Examples:
_ Pro Micro Nano Uno Size Smallest Slightly larger Large With Headers N/A $6 $11 Without Headers $8 $13 N/A
If so, click here to expand
You may be interested in building a simplified version of Mewt because you don't want to solder, or because it is a good way to learn/experiment, or as a project for your kids.
Get an Arduino Starter Kit:
It will come with everything you need (Arduino, breadboard, wires, buttons, LEDs, resistors). Plus you still have spare parts to make other projects when you're done!
Or a Microbit:
- $15
- You won't have to wire ANYTHING up, the buttons and LED displays are built-in.
- Skip over to the Microbit readme
Click to expand
Click to expand
-
Windows
Click to expand
- Click Start
- Type in device manager to search and open
- Scroll down to ports and expand it. Note: you may not see a Ports listing until after the next step, don't panic.
- Now plug your Arduino into your computer's USB port. Depending on your Arduino model, you may see some lights blink on your Arduino at this point.
- The Device Manager window may refresh at this point. scroll down to ports, and expand it (again).
- You should see a listing for Arduino [specific model] (COMx) where x is usually a number from 3 - 15
- Jot down the COMx serial port somewhere, we'll need to reference it later
-
Mac
Click to expand
- Click Finder->Applications->Utilities->Terminal
- In the Terminal window, type in ls /dev/tty.* and hit enter. Make a mental note of the results.
- Now plug your Arduino into your computer's USB port. Depending on your Arduino model, you may see some lights blink on your Arduino at this point.
- In the Terminal window, type in ls /dev/tty.* and hit enter (again).
- Jot down the new entry /dev/tty.XXXXXXXX serial port somewhere, we'll need to reference it later
-
Linux
Click to expand
- In a Terminal window, type in ls /dev/tty.* and hit enter. Make a mental note of the results.
- Now plug your Arduino into your computer's USB port. Depending on your Arduino model, you may see some lights blink on your Arduino at this point.
- In the Terminal window, type in ls /dev/tty.* and hit enter (again).
- Jot down the new entry /dev/tty.XXXXXXXX serial port somewhere, we'll need to reference it later
- In a Terminal window, type in ls /dev/tty.* and hit enter. Make a mental note of the results.
Click to expand
- Go to The Arduino Download Page to download the latest IDE for your OS
- Click on Windows Installer to download the latest version
- Install and launch the IDE
- Select File->New and delete everything in the new window that opens up
- Select Tools->Board and choose your Arduino model. for Pro Micros, choose Arduino Leonardo
- Select Tools->Ports and choose the same serial port that you jotted down earlier
- In the editor window paste in this code borrowed from Abdullah Al Mamun from Instructables.com
String a;
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}
void loop() {
while(Serial.available()) {
a= Serial.readString();// read the incoming data as string
Serial.println(a);
}
}
- Select Sketch->Verify/Compile. You can click Save when it prompts you to save the sketch folder.
- You should see a green Done Compiling status at the bottom of your Arduino window
- Select Sketch->Upload.
- You should see the status change to Uploading, the lights on the Arduino should blink, followed by a green Done Uploading status at the bottom of your Arduino window.
- If you get an error while uploading, some Arduino models require you to select your Bootloader. To do that, select Tools->Processor->(Old Bootloader) and try uploading again.
- Select Tools->Serial Monitor
- Make sure the 2 selections on the lower right hand of the screen are: Both NL & CR and 9600 baud
- In the text box, type in Hello World and click Send
- If all goes well, you should see the same words show up below the text box next to a timestamp
- Congratulations if this is your first Arduino program! Go get a gummi bear and shove it in your face!
Curious as to what the program did?
It created a variable (a) to be a placeholder. It then set speed at which the Arduino communicates with the computer over the Serial port (interesting tidbit, USB stands for Universal Serial Bus) to 9600 bauds. Remember that is also the speed that we are using to monitor the iteractions.
After that, it runs an infinite loop that checks the Serial port for data. If there's no data, it does nothing. But since it's an infinite loop, it will immediately check the Serial port for data again. This happens over and over again until finally you type in "Hello World" and hit Send. That sends the data from your computer over the Serial port to the Arduino. The check detects data when this happens. It will then use the variable (a) to temporarily hold on to that data. Lastly, it will dump that data back onto the Serial port for the computer to display.
This is why everything you type in the text box will show up in the output window after a small delay.
Click to expand
- SPST/SPDT/DPST/DPDT: Here's a link that explains it.
If your button is a SPST
Click to expand
Then, it should have 2 switch terminals.
- A Common (sometimes labeled C)
- A Normally Open (sometimes labeled NO)
If your button is a SPDT
Click to expand
Then, it should have 3 switch terminals.
- A Common (sometimes labeled C)
- A Normally Open (sometimes labeled NO)
- A Normally Closed (sometimes labeled NC)
- Connect the button NO terminal to D2 on your Arduino
- Connect the button C terminal to GND on your Arduino
Consider testing with jumper cables and a breadboard rather than directly soldering. It is easier to identify faulty components or make changes this way.
- in the editor window paste in this code
See the code
const int mewtButton = 2;
int mewtState = 0;
byte inByte;
int inInt;
void setup() {
Serial.begin(9600);
Serial.setTimeout(50);
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
pinMode(mewtButton, INPUT_PULLUP);
}
// the loop function runs over and over again forever
void loop() {
mewtState = digitalRead(mewtButton);
if (mewtState == LOW) {
digitalWrite(LED_BUILTIN, HIGH);
Serial.println("pressed");
delay(500);
}
if (mewtState == HIGH) {
digitalWrite(LED_BUILTIN, LOW);
Serial.println("released");
delay(500);
}
delay(500);
}
- Select Sketch->Verify/Compile. You can click Save when it prompts you to save the sketch folder.
- You should see a green Done Compiling status at the bottom of your Arduino window
- Select Sketch->Upload.
- You should see the status change to Uploading, the lights on the Arduino should blink, followed by a green Done Uploading status at the bottom of your Arduino window.
- If you get an error while uploading, some Arduino models require you to select your Bootloader. To do that, select Tools->Processor->(Old Bootloader) and try uploading again.
- Select Tools->Serial Monitor
- Make sure the 2 selections on the lower right hand of the screen are: Both NL & CR and 9600 baud
- If all goes well, you should see the word pressed in the output window every time you press the button. It should display released when you let go of the button.
- If you get the opposite result of what you are looking for (output says pressed when you release the button and it says released when you press the button), simply swap the wires connecting to the button terminals
- Congratulations if this is your first time connecting a piece of physical hardware to your code! Go get another gummi bear and shove it in your face!
Curious as to what the program did?
It sets a variable (**mewtButton**) to the Arduino #2 pin, and creates a variable (**mewtState**).
It sets the Serial speed to be 9600, and a timeout of 50 (milliseconds). The default timeout is 1 second, so a 50 millisecond time will allow faster responses from the Arduino.
We also initialize LED_BUILTIN (Arduino's built-in LED) and the MewtButton. INPUT_PULLUP uses Arduino's built-in resistor so you can avoid having to physically wire in a resistor to make the button work.
Inside the infinite loop, we read the current state from mewtButton, which is reading from Arduino's #2 pin, and puts it into mewtState variable.
Then we check the value of the state. If it is LOW, then that means that the button has been pressed. We then output that state by turning on LED_BUILTIN and also write pressed on the serial port to be displayed by the computer. That will happen as long as the button is pressed.
If we release the button, then mewtState would be HIGH. We then output that state by turning off LED_BUILTIN and also write released on the serial port to be displayed by the computer. That will happen as long as the button is pressed.
Click to expand
- Common Cathode vs Common Anode: Here's a link that explains it.
If LED is Common Cathode
Click to expand
-
A Common (sometimes labeled C or -) - you will connect this to GND on your Arduino
-
A Terminal for every color LED in your light - You will start by identifying the terminal for the red LED and connecting it to the D4 pins on your Arduino
-
in the editor window paste in this code
See the code
const int led0 = 0;
const int led1 = 1;
const int led3 = 3;
const int led4 = 4;
const int led5 = 5;
const int led6 = 6;
const int led7 = 7;
const int led8 = 8;
const int led9 = 9;
const int led10 = 10;
const int led11 = 11;
const int led12 = 12;
const int led13 = 13;
const int mewtButton = 2;
int mewtState = 0;
byte inByte;
int inInt;
void setup() {
Serial.begin(9600);
Serial.setTimeout(50);
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
pinMode(led0, OUTPUT);
pinMode(led1, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
pinMode(led6, OUTPUT);
pinMode(led7, OUTPUT);
pinMode(led8, OUTPUT);
pinMode(led9, OUTPUT);
pinMode(led10, OUTPUT);
pinMode(led11, OUTPUT);
pinMode(led12, OUTPUT);
pinMode(led13, OUTPUT);
pinMode(mewtButton, INPUT_PULLUP);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(led0, HIGH);
digitalWrite(led1, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
digitalWrite(led6, HIGH);
digitalWrite(led7, HIGH);
digitalWrite(led9, HIGH);
digitalWrite(led10, HIGH);
digitalWrite(led11, HIGH);
digitalWrite(led12, HIGH);
digitalWrite(led13, HIGH);
mewtState = digitalRead(mewtButton);
if (mewtState == LOW) {
digitalWrite(LED_BUILTIN, HIGH);
Serial.println("pressed");
delay(50);
}
if (mewtState == HIGH) {
digitalWrite(LED_BUILTIN, LOW);
Serial.println("released");
delay(50);
}
}
If LED is Common Anode
Click to expand
-
A Common (sometimes labeled C or +) - you will connect this to 5V/VCC on your Arduino
-
A Terminal for every color LED in your light - You will start by identifying the terminal for the red LED and connecting it to the D4 pins on your Arduino
-
in the editor window paste in this code
See the code
const int led0 = 0;
const int led1 = 1;
const int led3 = 3;
const int led4 = 4;
const int led5 = 5;
const int led6 = 6;
const int led7 = 7;
const int led8 = 8;
const int led9 = 9;
const int led10 = 10;
const int led11 = 11;
const int led12 = 12;
const int led13 = 13;
const int mewtButton = 2;
int mewtState = 0;
byte inByte;
int inInt;
void setup() {
Serial.begin(9600);
Serial.setTimeout(50);
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
pinMode(led0, OUTPUT);
pinMode(led1, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
pinMode(led6, OUTPUT);
pinMode(led7, OUTPUT);
pinMode(led8, OUTPUT);
pinMode(led9, OUTPUT);
pinMode(led10, OUTPUT);
pinMode(led11, OUTPUT);
pinMode(led12, OUTPUT);
pinMode(led13, OUTPUT);
pinMode(mewtButton, INPUT_PULLUP);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(led0, LOW);
digitalWrite(led1, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
digitalWrite(led6, LOW);
digitalWrite(led7, LOW);
digitalWrite(led9, LOW);
digitalWrite(led10, LOW);
digitalWrite(led11, LOW);
digitalWrite(led12, LOW);
digitalWrite(led13, LOW);
mewtState = digitalRead(mewtButton);
if (mewtState == LOW) {
digitalWrite(LED_BUILTIN, HIGH);
Serial.println("pressed");
delay(50);
}
if (mewtState == HIGH) {
digitalWrite(LED_BUILTIN, LOW);
Serial.println("released");
delay(50);
}
}
- Select Sketch->Verify/Compile. You can click Save when it prompts you to save the sketch folder.
- You should see a green Done Compiling status at the bottom of your Arduino window
- Select Sketch->Upload.
- You should see the status change to Uploading, the lights on the Arduino should blink, followed by a green Done Uploading status at the bottom of your Arduino window.
- If all goes well, your LED will have lit up.
- Congratulations you're a pro at this point! Go get a third gummi bear!
- Disconnect the red LED from D4 and connect the blue LED to D7
- Disconnect the blue LED and from D7 connect the green LED to D9
- Congratulations you have successfully tested all the components you need to make a fully functional Mewt! Go get a gummi worm this time!
If you have an LED separate from your button (i.e. if you are building a Mewt Basic)
Click to expand
Connect your button/LED to your Arduino using the wiring applicable to your components
Click to expand
Click to expand
- Program your Microbit using this project
- Skip to the section Connect your computer to your Mewt
_ | Common Cathode LED | Common Anode LED |
---|---|---|
Momentary Button | pc_momentary_common_cathode.ino | pc_momentary_common_anode.ino |
Latching Button | pc_latch_rgb_common_cathode.ino | pc_latch_rgb_common_anode.ino |
_ | Common Cathode LED | Common Anode LED |
---|---|---|
Momentary Button | maclinux_momentary_common_cathode.ino | maclinux_momentary_common_anode.ino |
Latching Button | maclinux_latch_rgb_common_cathode.ino | maclinux_latch_rgb_common_anode.ino |
Curious as to how these programs differ?
-
A Common Cathode LED shares a connection to Arduino's GND (-). Arduino sets the state based on changing the voltage applied to the pin. When you want to turn on an LED light, the code instructs Arduino to send a value of HIGH
-
A Common Anode LED shares a connection to Arduino's 5V/VCC (+). When you want to turn on an LED light, the code instructs Arduino to send a value of LOW
-
A Latching Button stays locked to an on state or an off state depending on if you've pressed or released the button. Arduino can simply read the current state to figure out if you intend Mewt to be enabled or not.
-
A Momentary Button resets itself when you release the button. Because of this lack of memory (or state), Arduino cannot rely on the status of the button to tell if Mewt should be enabled or not. Instead, Arduino needs to keep track of the state inside the code with the use of a variable.
-
The PC Mewt streams back the microphone mute/unmute state and transmitted volume (if applicable). Therefore, Mewt can rely on a continuous state signal to decide which color to display.
-
The Mac / Linux Mewt currently cannot stream back mute/unmute state and transmitted volume. Mewt relies on knowledge of the mute/unmute state of the microphone at the time of button press to determine which color to display.
- Load the program applicable to your components into your Arduino IDE editor
- Select Sketch->Verify/Compile. You can click Save when it prompts you to save the sketch folder.
- You should see a green Done Compiling status at the bottom of your Arduino window
- Select Sketch->Upload.
- You should see the status change to Uploading, the lights on the Arduino should blink, followed by a green Done Uploading status at the bottom of your Arduino window.
- Select Tools->Serial Monitor
- Make sure the 2 selections on the lower right hand of the screen are: Both NL & CR and 9600 baud
- If all goes well you should have the below reults
- when you press the button you should see the Green LED come on and the Arduino IDE window output should display either 1 or 0. Every time you press the button again, the value you see will toggle back and forth
Type this into Arduino text box | This should light up |
---|---|
0 | Red |
1 | Blue |
2 | Green |
3 | Purple |
4 | Yellow |
5 | White |
101 | Flash Green 3x |
- Congratulations you have a fully functional Mewt! Upgrade your gummi worm to a sour gummi worm!
Click to expand
-
Windows
Click to expand
- Download mewt.exe
your browser may give you a warning when you try to download. Select Keep to continue downloading. - IMPORTANT please UNPLUG Mewt from your computer's USB before continuing.
- Find where you downloaded mewt.exe and run the file.
- Windows Defender / User Access Control may ask several times if you want to continue, follow screenshots to continue.
- You will then see Mewt install itself
- You will see a prompt to plug Mewt into a USB port
- When you plug in your Mewt, the prompt will disappear. Your Mewt may flash a white light briefly. After a short delay, Mewt will light up with a steady Blue or Red light depending on whether your microphone is currently Unmuted or currently Muted. Based on your system/Arduino setup, it may take 15-20 seconds for the steady light to come on.
- The very first time you use Mewt, you will need to press the button twice in order to activate it (sorry, it's a bug, still a work-in-progress). After it has been activated, every single button press will turn every microphone in your system from Unmuted to Muted, and vice versa. Below are what the colors represent:
Color Represents 0 Muted 1 Unmuted, but not transmitting 2 Button pressed 3 Hot-mic display 4 Hot-mic display 5 Hot-mic display 101 Microphone devices have changed - To test out Mewt, go to online-voice-recorder.com, and click on the red button to record. You should see it react to any sounds your microphone picks up.
Curious as to what the installation program did? Did the installation not work? Click here to expand
- mewt.exe is a self-extracting version of mewt.zip.
- Download mewt.zip to your computer
- Navigate to where you saved mewt.zip, right click on it and select Extract All
- In the next window, type in c:\mewt then Extract
- IMPORTANT please UNPLUG Mewt from your computer's USB before continuing.
- In File Explorer navigate to c:\mewt, right click on setup_mewt.bat (its icon has gears in it), then select Open
- You will see a prompt to plug Mewt into a USB port
- When you plug in your Mewt, the prompt will disappear. Your Mewt may flash a white light briefly. After a short delay, Mewt will light up with a steady Blue or Red light depending on whether your microphone is currently Unmuted or currently Muted. Based on your system/Arduino setup, it may take 15-20 seconds for the steady light to come on.
- The very first time you use Mewt, you will need to press the button twice in order to activate it (sorry, it's a bug, still a work-in-progress). After it has been activated, every single button press will turn every microphone in your system from Unmuted to Muted, and vice versa.
- Download mewt.exe
-
Mac
Click to expand
- Download mewt.zip
your browser may give you a warning when you try to download. Select Keep to continue downloading. - IMPORTANT please UNPLUG Mewt from your computer's USB before continuing.
- Navigate to where you saved mewt.zip from Finder->Downloads, right click on it and select Open With->Archive Utility
- Open Terminal from Finder->Applications->Utilities->Terminal
- In the Terminal console, navigate to where you unzipped mewt.zip typically this is cd $HOME/Downloads/mewt
- Type in python mac_install_mewt.py, wait for the prompt to plug in your Mewt
- When you plug in your Mewt, the prompt will disappear. Your Mewt may flash a white light briefly. After a short delay, Mewt will light up with a steady Blue. Based on your system/Arduino setup, it may take 15-20 seconds for the steady light to come on.
- Download mewt.zip
-
Linux
Click to expand
- Download mewt.zip
- IMPORTANT please UNPLUG Mewt from your computer's USB before continuing.
- Navigate to where you extracted mewt.zip from Terminal
- Type in python3 linux_install_mewt.py, wait for the prompt to plug in your Mewt
- When you plug in your Mewt, the prompt will disappear. Your Mewt may flash a white light briefly. After a short delay, Mewt will light up with a steady Blue. Based on your system/Arduino setup, it may take 15-20 seconds for the steady light to come on.
- Run pacmd list-sources to list all audio devices in your system.
- With online-voice-recorder.com running, iterate through your sources with the below command until you identify the one that will correctly mute your microphone pacmd set-source-mute X 1 where X = your source number. Start with 0 and work upwards
- Once you have identified your microphone, grep pacmd linux_mewt.py to find the 2 instances where it's called and replace the microphone index.
- Here are some links to get you started when you inevitably run into dependency/libraries/access issues
- How to install python3-pip on ubuntu 20.04
- SerialException: could not open port /dev/ttyACM0
- Command to mute and unmute a microphone
Click to expand
-
Windows
Click to expand
- In File Explorer navigate to C:\mewt
- To run Mewt in Headless/No-User-Interface mode, run start_mewt.bat
- To exit from Headless/No-User-Interface mode, simply unplug your Mewt from the USB port
- To run Mewt in Verbose mode, run start_mewt_verbose.bat. This will open a console that will provide more information.
- To exit from Verbose mode, you can hit Ctrl+C, or close the PowerShell window or simply unplug your Mewt from the USB port
- The very first time you use Mewt, you will need to press the button twice in order to activate it (sorry, it's a bug, still a work-in-progress). After it has been activated, every single button press will turn the primary microphone in your system from Unmuted to Muted, and vice versa.
-
Mac
Click to expand
- Open Terminal from Finder->Applications->Utilities->Terminal
- In the Terminal console, navigate to where you unzipped mewt.zip typically this is cd $HOME/Downloads/mewt
- Type in python mewt.py
- To exit from Verbose mode, you can hit Ctrl+C, or close the PowerShell window or simply unplug your Mewt from the USB port
- The very first time you use Mewt, you will need to press the button twice in order to activate it (sorry, it's a bug, still a work-in-progress). After it has been activated, every single button press will turn the primary microphone in your system from Unmuted to Muted, and vice versa.
- After you exit Mewt from the terminal, the light on the button will stay on until you restart Mewt or you unplug Mewt from the USB port
-
Linux
Click to expand
- Open Terminal
- In the Terminal console, navigate to where you unzipped mewt.zip
- Type in python3 linux_mewt.py
- The very first time you use Mewt, you will need to press the button twice in order to activate it (sorry, it's a bug, still a work-in-progress). After it has been activated, every single button press will turn the primary microphone in your system from Unmuted to Muted, and vice versa.
- After you exit Mewt from the terminal, the light on the button will stay on until you restart Mewt or you unplug Mewt from the USB port
Click to expand
Here are some different ways Mewt can be implemented.
Click to expand
-
Arduino
Click to expand
Mewt's Arduino code wires the below inputs, outputs and placeholders together:Input from user
- Button: User issues command to Mewt to mute/unmute microphone by pressing the button
Output to computer
- Serial: Arduino opens up a communications channel to pass along the user input via commands to the computer. 1=mute, 0=unmute
Input from computer
- Serial: After the computer issues the command to mute/unmute the system microphone, it passes a value to Arduino to represent the current state of the microphone. 0=muted, 1=umuted. It is also possible to receive values >1 if the computer supports streaming microphone volume data (for hot-mic support).
Output to user
- LED: Arduino takes the input from computer and maps them into different colors to be displayed to the user via the combination of RGB LED lights.
Value Meaning RGB Color 0 Muted R Red 1 Unmuted B Blue 2 Button pressed G Green mod 3 = 0 (3, 6, 9, etc.) Hot-mic RB Purple mod 3 = 1 (4, 7, 10, etc.) Hot-mic RG Yellow mod 3 = 2 (5, 8, 11, etc.) Hot-mic RGB White 101 There's a change to the system audio devices G G G Flashes green 3x Placeholders
- toggleState: for momentary buttons, this help to keep track of whether the last button press resulted in a mute or an unmute, since you cannot read this off the button itself
- lastLedDisplayUpdate: keeps track of when the last udpate came in from the computer, helps it figure out when Mewt is no longer running on the computer
- lastVolume: keeps track of the previous volume. This is currently deprecated. It was previously used to detect volume changes to allow a single LED light to be flickered for Hot-mic if there was no RGB available
- ledDisplay: holds the value received from the computer and is used to determine which color LED to light
Pseudocode
- Read current state of button
- Read value from computer
- Figure out what RGB to turn on depending on value from computer
- Timestamps last value from computer
- If it's been longer than 1 second since last value from computer, shut down all LEDs to avoid user confusion
- If button was pressed, turn on Green LED to provide feedback to user
- Read current state of button again
- If button was previously pressed, and is now released, then user has toggled mute/unmute. Save mute state to memory. Send command via serial to computer.
-
Windows
Click to expand
Mewt Windows leverages the AudioDeviceCmdlets PowerShell library for its communications with system microphones. See Acknowledgments
Setup Pseudocode
- Reads command line arguments *Passing Zoom or Meet as an argument will make Mewt attempt to send the shortcut for application-level muting respectively
- Reads the COM port to look for Mewt on from mewt_com_port.txt. should have been detected and written as part of the setup
- Imports AudioDeviceCmdlets library
- If it's the first time Mewt/AudioDeviceCmdlets has run on this computer, it will install/copy the files to the correct directories for future use
- Opens a separate process to output the volume stream of the current microphone to a file out.txt
- Creates a Serial bus communicatioons using the COM port from above
- Sends 101 to Mewt to display flashing green light to indicate Mewt is starting up
- Clears the console and outputs Mewt Ready for verbose mode
- Declares some temporary variables to keep state for last button state and unmewtable device I encountered USB microphone that unmuted itself right after a mute command was sent that needed specialized treatment
- Takes a snapshot of all system audio devices, filtered down to just the microphones/recording devices
- Starts a timer to gauge how long each press is taking to effect for verbose mode
Loop Pseudocode
- Take the last value from audio stream and write it to mewt_stream.txt
- Queries current mute state from computer and inverts it *AudioDeviceCmdlets returns 1 for mute, but Mewt sends 0 for mute in order to more logically support hot-mic
- If current state is unmuted, but microphone is capturing no volume, AudioDeviceCmdlets returns 0. Replace this 0 to 1 before sending to Mewt
- Otherwise, send last volume value to Mewt
- Check against previous mute state to prevent unnecessary commands sending mute when microphone is currently muted
- Read button state from Arduino
- Timestamps mute state change start
- If we received Zoom or Meet from command line argument, then switch windows focus to Zoom or Google Chrome respectively and send appropriate shortcut key the Chrome tab that Meet is on has to be the in-focus tab for this to work
- Iteratives through each available system microphone and mutes them individually, making sure to save the primary microphone, and checking if there's been a change of devices removed a device or added a device
- For every microphone muted/unmuted, timestamps how long it took from start to finish
- Checks for unmewtable device if user wants to mute, and we muted every microphone, but a microphone subsequently reports that it's unmuted
- Waits for a fraction over half a second and mutes that unmewtable device again beats me why this works, it just does
- Once we have discovered an unmewtable device, we will save it so that we don't waste time checking it every time. Mewt will go directly to doing a 2nd mute attempt on these devices
- Exits if port to Arduino no longer active if Mewt is physically unplugged
-
Mac
Click to expand
Mewt Mac leverages AppleScript in order to set the recording volume of the primary microphone to 0 for mute, and 100 for unmute. *There is a more robust way to actually mute microphones (as opposed to setting volume to 0), and to iterate through each microphone. To do so, we can leverage the Audio MIDI Setup application. However, this currently takes 3-5 seconds per toggle and is not efficient enough to use without further optimization.
Setup Pseudocode
- Reads the COM port to look for Mewt on from port_arduino. should have been detected and written as part of the setup
- Creates a Serial bus communicatioons using the COM port from above
- Declares some temporary variables to keep state for last button state
- Sends 101 to Mewt to display flashing green light to indicate Mewt is starting up
- Clears the console
Loop Pseudocode
- Read button state from Arduino
- test_data.csv refers to hot-mic feature that is currently being tested and not yet integrated
- If 1 received, then mute by calling mac_native_mewt.scpt AppleScript
- Otherwise, if 0 received, then unmute by calling mac_native_unmewt.scpt AppleScript
- Write 1/0 for mute/unmute to serial so Arduino can display the correct status lights
-
Linux
Click to expand
Mewt Linux was tested on Ubuntu 20.04 LTS and 18.04LTS. It leverages the PulseAudio library for its communications with system microphones. See Acknowledgments The code currently mutes/unmutes a single microphone as opposed to iterating through every single device. Since you're a Linux user, have at it!
Setup Pseudocode
- Reads the COM port to look for Mewt on from port_arduino. should have been detected and written as part of the setup
- Creates a Serial bus communicatioons using the COM port from above
- Declares some temporary variables to keep state for last button state
- Sends 101 to Mewt to display flashing green light to indicate Mewt is starting up
- Clears the console
Loop Pseudocode
- Read button state from Arduino
- test_data.csv refers to hot-mic feature that is currently being tested and not yet integrated
- If 1 received, then mute by calling pacmd set-source-mute X 1 _where X is microphone to be muted
- Otherwise, if 0 received, then unmute by calling pacmd set-source-mute _X_01 _where X is microphone to be unmuted
- Write 1/0 for mute/unmute to serial so Arduino can display the correct status lights
Click to expand
All I ask is that you take a moment to do something kind.
-
Think of what you would have been willing to contribute to the Mewt project (however small the amount), and donate that to your favorite charity instead.
-
See someone hungry or cold? Buy them a small meal or cheap socks.
-
Have elderly neighbors? Offer to help shovel their driveway or mow their lawn.
-
People across the political divide have you on edge? Bake them some cookies just to be nice.
-
Even something as simple as given a random stranger your best smile.
If you can report back via this 5 second #UnMewtForGood questionnaire, it would really make my day. I'm hoping we can push out $1000 and/or 100 hours of kindness from this little corner of the internet.
Join me on the Mewt Discord
-
FAQ (Frequently Asked Questions)
Click to expand
- Can you make it work without an RGB?
Yes. Without an RGB, there are fewer ways to provide feedback about the microphone state, but we can still make it work. Examples: 2 colors (1 for mute, 1 for unmute, blink unmute for hot mic), 1 color (on for mute, off for unmute, no hot mic), no LED (no feedback)
- The powershell window keeps opening and closing endlessly and I am seeing "faulty audio device" when running verbose mode. Windows 10 may be blocking the DLL
Go into C:\mewt and right clicked on the DLL and selected properties. Check the box to unblock the DLL and hit apply. Thank you @shatter71!
Click to expand
Kulfsson | ||||
---|---|---|---|---|
mattlag | ||||
birlaP | ||||
Joe_Shmow | ||||
Thomas Neis |
Click to expand
- Mewt's Windows implementation leverages the AudioDeviceCmdlets library, Copyright © 2016-2018 Francois Gendron [email protected]
- Mewt's Linux implementation leverages the PulseAudio library.
- Mewt's Windows Self-Extracting Executable file makes use of the Shushing Face Icon from the OpenMoji project.