Anc813 / MicMute

Mute default mic clicking tray icon or shortcut
MIT License
138 stars 23 forks source link

Toggle led over USB #35

Closed andrebian closed 2 years ago

andrebian commented 2 years ago

It is possible to toggle a led light over USB to indicate that the mic is on? Just a question. I've cloned the repository and I'm starting to study C# to implement this, but if some good soul can help me with this feature, I would appreciate it.

Motivation

In the company I work in, we use a virtual office and is very common for someone to approach us without us being aware of this. If the mic is open accidentally, the person on the other side can hear all I am doing, talking about, songs I'm playing, phone conversations, even relationship discussion, by the way, etc. And of course, just following the webcam principle: a led indicates that capture is active.

I know that the icon is intuitive, but only if I am right in front of the computer. As mentioned, compared with a webcam, I would be able to know if the mic is capturing far from the computer, when I am preparing a coffee, playing with my kids, and even more.

wjcarpenter commented 2 years ago

Some custom USB device is always possible, but there is a generic possibility you might look into. The USB Human Interface Device (HID) profile is the scheme that keyboards, mice, and a few other things use to talk to the PC. The USB HID has definitions for pretty much anything you would find on any modern keyboard, including the media control keys (volume up/down, play/pause, etc).

But, for your question ... in the responses from the PC back to the device, there are some bits reserved for indicating state. They are usually used for the LEDs on a keyboard: caps lock, num lock, etc. For example, you press the caps lock key on your keyboard. The keyboard sends up the key code for caps lock. The PC responds with one of those bits set to tell the keyboard to light or extinguish the caps lock LED. You could repurpose those bits to have whatever meaning you wanted. How you would do that in software on a PC ... well, I don't know the answer to that, but let us know if you figure it out! :-)

BTW, Bluetooth HID incorporates the USB HID and just adds things specifically related to operating over BT. I came across the above info while reading about BT, and I assume it's the same for USB HID. But, to be honest, I don't know if USB does it the same way with those state bits.

andrebian commented 2 years ago

I appreciate your explanation @wjcarpenter. I am looking for some device or microchip to make it possible too. I will be keeping on research, in case of success, I will share the solution.

innesst commented 2 years ago

There are some commercial physical button / light solutions: muteme.com mutesync.com

This has Arduino code so you can make your own button: github.com/GeorgeArgyrakis/YouAreMuted

andrebian commented 2 years ago

@innesst this is awesome! The physical solutions are a little expensive for me right now. I live in Brazil and paying something in U$ means that the amount needs to be multiplied by 5. But the Arduino solution seems to be an alternative, I have an Arduino in my cabinet, maybe just buy some buttons for that.

wjcarpenter commented 2 years ago

And if you are just looking for an indicator (not including some external button), there are several off-the-shelf LED gizmos that you can plug into a USB port and control from PC software. (I was going to include some links, but I would just be pretending to curate the same things you would find yourself with a web search.)

andrebian commented 2 years ago

Thanks a lot for your support on this issue. I've made the Arduino solution and soon I'll send you a video about the tool at work. For now I'm closing this issue, thanks again.