Git Product home page Git Product logo

mewt's Introduction

Mewt

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

mewtdemo

Muted Unmuted Hot Mic
mewt unmewt Hot Mic

How Mewt works

Click to expand

Mewt is made up of 2 parts:

  1. Physical components
    1. A physical button to control mute state, with a built-in RGB LED to display mute state / hot-mic
    2. An Arduino microcontroller to interface with the button and the LED. This is also what will communicate with your computer
  2. Code running on your computer to
    1. Recognize button presses to toggle microphone mute/unmute
    2. Read microphone mute/unmute state and send information to the physical components to display status
    3. Read microphone volume levels and send information to the physical components to display hot-mic mewtdesign

How to build Mewt

Click to expand

Get physical components

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

1. Get a button (~$3 - $20)

  • $18deluxemomentary

    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* basiclatching$3 basicmomentary$3 basictoggleswitch$3
    Deluxe deluxelatching$8 deluxemomentary$18 deluxetoggleswitch$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

2. Get an Arduino microcontroller (~$10)

  • $8cheappromicro

    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 headers and a breadboard breadboard. Headers are the pins that stick out from the Arduino

    Examples:

    _ Pro Micro Nano Uno
    Size Smallest promicro Slightly larger nano Large uno
    With Headers N/A $6 $11
    Without Headers $8 $13 N/A

3. Get wires, solder, soldering iron

Don't want to solder?

If so, click here to expand

Basic Mewt

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.

mewtbasic

Get an Arduino Starter Kit:

  • $20arduinostarterkit

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:

  • $15microbit
  • You won't have to wire ANYTHING up, the buttons and LED displays are built-in.
  • Skip over to the Microbit readme

Test physical components

Click to expand

1. Plug in your Arduino and find its COM port

Click to expand
  • Windows

    Click to expand
    1. Click Start clickstart
    2. Type in device manager to search and open devicemanager
    3. Scroll down to ports and expand it. Note: you may not see a Ports listing until after the next step, don't panic.
    4. 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.
    5. The Device Manager window may refresh at this point. scroll down to ports, and expand it (again).
    6. You should see a listing for Arduino [specific model] (COMx) where x is usually a number from 3 - 15 ports
    7. Jot down the COMx serial port somewhere, we'll need to reference it later
  • Mac

    Click to expand
    1. Click Finder->Applications->Utilities->Terminal terminal
    2. In the Terminal window, type in ls /dev/tty.* and hit enter. Make a mental note of the results.
      portsbeforearduino
    3. 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.
    4. In the Terminal window, type in ls /dev/tty.* and hit enter (again). portsafterarduino
    5. Jot down the new entry /dev/tty.XXXXXXXX serial port somewhere, we'll need to reference it later
  • Linux

    Click to expand
    1. In a Terminal window, type in ls /dev/tty.* and hit enter. Make a mental note of the results.
      portsbeforearduino
    2. 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.
    3. In the Terminal window, type in ls /dev/tty.* and hit enter (again). portsafterarduino
    4. Jot down the new entry /dev/tty.XXXXXXXX serial port somewhere, we'll need to reference it later

2. Download and install the Arduino IDE to test your Arduino

Click to expand
  1. Go to The Arduino Download Page to download the latest IDE for your OS
  2. Click on Windows Installer to download the latest version arduinodownload
  3. Install and launch the IDE
  4. Select File->New and delete everything in the new window that opens up
  5. Select Tools->Board and choose your Arduino model. for Pro Micros, choose Arduino Leonardo boards
  6. Select Tools->Ports and choose the same serial port that you jotted down earlier portselection
  7. 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);
 }
}
  1. Select Sketch->Verify/Compile. You can click Save when it prompts you to save the sketch folder.
    verifycompile
  2. You should see a green Done Compiling status at the bottom of your Arduino window donecompiling
  3. Select Sketch->Upload. upload
  4. 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. doneuploading
  5. 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.
    processorbootloader
  6. Select Tools->Serial Monitor serialmonitor
  7. Make sure the 2 selections on the lower right hand of the screen are: Both NL & CR and 9600 baud serialmonitorparameter
  8. In the text box, type in Hello World and click Send
  9. If all goes well, you should see the same words show up below the text box next to a timestamp helloworld
  10. 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.

3. Test your button

Click to expand

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.
spdtschematics

  • 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. buttontestwiring

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);
}
  1. Select Sketch->Verify/Compile. You can click Save when it prompts you to save the sketch folder.
    verifycompile
  2. You should see a green Done Compiling status at the bottom of your Arduino window donecompiling
  3. Select Sketch->Upload.
    upload
  4. 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. doneuploading
  5. 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.
    processorbootloader
  6. Select Tools->Serial Monitor serialmonitor
  7. Make sure the 2 selections on the lower right hand of the screen are: Both NL & CR and 9600 baud serialmonitorparameter
  8. 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. buttontest
  9. 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
  10. 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.

4. Test your LED

Click to expand

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 ledtestwiring-commoncathode

  • 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 ledtestwiring-commonannode

  • 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);
  }
}
  1. Select Sketch->Verify/Compile. You can click Save when it prompts you to save the sketch folder.
    verifycompile
  2. You should see a green Done Compiling status at the bottom of your Arduino window donecompiling
  3. Select Sketch->Upload. upload
  4. 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. doneuploading
  5. If all goes well, your LED will have lit up.
  6. Congratulations you're a pro at this point! Go get a third gummi bear!
  7. Disconnect the red LED from D4 and connect the blue LED to D7
  8. Disconnect the blue LED and from D7 connect the green LED to D9
  9. 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 You will also need to add an inline resistor with every color terminal. Follow the above directions, but use this wiring instead:

Common cathode

Click to expand

ledtestwiring-commonanode-resistor

Common Anode

Click to expand

ledtestwiring-commonanode-resistor

Assemble your Mewt

Click to expand

Connect your button/LED to your Arduino using the wiring applicable to your components

  • Button terminal -> D2

  • Button common -> GND

  • LED red -> D4

  • LED blue -> D7

  • LED green -> D9

  • LED common (anode) -> 5V/VCC

  • LED common (cathode) -> GND

    _ Common Cathode LED Common Anode LED
    Deluxe (no additional resistors) mewtwiring-commoncathode mewtwiring-commonanode
    Basic (with resistors) mewtbasicwiring-commoncathode mewtbasicwiring-commonanode

Test your assembled Mewt

Click to expand

MicroBit

Click to expand
  • Program your Microbit using this project
  • Skip to the section Connect your computer to your Mewt

PC

_ 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

Mac and Linux

_ 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.

  1. Load the program applicable to your components into your Arduino IDE editor
  2. Select Sketch->Verify/Compile. You can click Save when it prompts you to save the sketch folder.
    verifycompile
  3. You should see a green Done Compiling status at the bottom of your Arduino window donecompiling
  4. Select Sketch->Upload. upload
  5. 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. doneuploading
  6. Select Tools->Serial Monitor serialmonitor
  7. Make sure the 2 selections on the lower right hand of the screen are: Both NL & CR and 9600 baud serialmonitorparameter
  8. 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

testmewtbuttonpress

Type this into Arduino text box This should light up
0 Red red
1 Blue blue
2 Green green
3 Purple purple
4 Yellow yellow
5 White white
101 Flash Green 3x greenblink3x
  • Congratulations you have a fully functional Mewt! Upgrade your gummi worm to a sour gummi worm!

Connect your computer to your Mewt

Click to expand
  • Windows

    Click to expand
    1. Download mewt.exe
      your browser may give you a warning when you try to download. Select Keep to continue downloading. keepanyway
    2. IMPORTANT please UNPLUG Mewt from your computer's USB before continuing.
    3. Find where you downloaded mewt.exe and run the file.
    4. Windows Defender / User Access Control may ask several times if you want to continue, follow screenshots to continue. windowsdefenderrunanywayunknownpublisher
    5. You will then see Mewt install itself installingmewt
    6. You will see a prompt to plug Mewt into a USB port pluginmewt
    7. 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. mewtfirsttime
    8. 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 red
    1 Unmuted, but not transmitting blue
    2 Button pressed green
    3 Hot-mic display purple
    4 Hot-mic display yellow
    5 Hot-mic display white
    101 Microphone devices have changed greenblink3x
    • 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.
      onlinevoicerecorder
      mewtdemo

    Curious as to what the installation program did? Did the installation not work? Click here to expand

    1. mewt.exe is a self-extracting version of mewt.zip.
    2. Download mewt.zip to your computer
    3. Navigate to where you saved mewt.zip, right click on it and select Extract All extractall
    4. In the next window, type in c:\mewt then Extract extracttocmewt
    5. IMPORTANT please UNPLUG Mewt from your computer's USB before continuing.
    6. In File Explorer navigate to c:\mewt, right click on setup_mewt.bat (its icon has gears in it), then select Open setup_mewt.bat
    7. You will see a prompt to plug Mewt into a USB port pluginmewt
    8. 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. mewtfirsttime
    9. 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.
  • Mac

    Click to expand
    1. Download mewt.zip
      your browser may give you a warning when you try to download. Select Keep to continue downloading. keepanyway
    2. IMPORTANT please UNPLUG Mewt from your computer's USB before continuing.
    3. Navigate to where you saved mewt.zip from Finder->Downloads, right click on it and select Open With->Archive Utility extractall
    4. Open Terminal from Finder->Applications->Utilities->Terminal
    5. In the Terminal console, navigate to where you unzipped mewt.zip typically this is cd $HOME/Downloads/mewt
    6. Type in python mac_install_mewt.py, wait for the prompt to plug in your Mewt macinstall
    7. 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. mewtready
  • Linux

    Click to expand
    1. Download mewt.zip
    2. IMPORTANT please UNPLUG Mewt from your computer's USB before continuing.
    3. Navigate to where you extracted mewt.zip from Terminal
    4. Type in python3 linux_install_mewt.py, wait for the prompt to plug in your Mewt
    5. 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.
    6. Run pacmd list-sources to list all audio devices in your system.
    7. 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
    8. 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.

Running Mewt

Click to expand
  • Windows

    Click to expand
    1. In File Explorer navigate to C:\mewt
    2. To run Mewt in Headless/No-User-Interface mode, run start_mewt.bat startmewt
    • To exit from Headless/No-User-Interface mode, simply unplug your Mewt from the USB port
    1. To run Mewt in Verbose mode, run start_mewt_verbose.bat. This will open a console that will provide more information. startmewtverbose mewtverbose
    • 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
    1. Open Terminal from Finder->Applications->Utilities->Terminal
    2. In the Terminal console, navigate to where you unzipped mewt.zip typically this is cd $HOME/Downloads/mewt
    3. Type in python mewt.py mewtready
    • 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
    1. Open Terminal
    2. In the Terminal console, navigate to where you unzipped mewt.zip
    3. 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

Make your enclosure

Click to expand

Here are some different ways Mewt can be implemented.

@Dakota-Mewt's 3D printed top Dakota-Mewt's 3D printed bottom @Dakota-Mewt's 3d printed enclosure
@dakota-mewt'stop @dakota-mewt'sbottom [@dakota-mewt'spicture]
@kulfsson's 3D printed top @kulfsson's 3D printed bottom @kulfsson's 3D printed enclosure
@kulfsson'stop @kulfsson'sbottom @kulfsson'spicture
Small Button Medium Button Medium Button
smallbutton mediumbutton mediumbutton2
Huge Button Switch Stick
hugebutton switch stick
Snap Circuits Microbit Basic
snapcircuits microbit basic

How does the Mewt code work

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

How you can support Mewt

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.

Questions/Comments/Help

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!

Community Showcase

Click to expand
Kulfsson 1 2 3 4
mattlag 1
birlaP 1 2 3
Joe_Shmow 1
Thomas Neis 1

Acknowledgments

Click to expand

mewt's People

Contributors

dakota-mewt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.