lx-s / WinMute

WinMute lets you automatically mute your PC volume on certain events (e. g. Screensaver, Workstation Lock, Shutdown, etc.).
BSD 3-Clause "New" or "Revised" License
168 stars 6 forks source link

New triggers: auto mute on disconnect (bluetooth) headset #14

Closed Rediwed closed 2 years ago

Rediwed commented 2 years ago

Hi lx-s, incredibly happy to have found your app recently. I've been looking for an alternative to Automute on macOS ever since I've had to switch to Windows for work purposes. Your app seems to be almost the same as AutoMute, but I'm missing one thing: the ability to auto mute whenever your (bluetooth / aux) headphones disconnect.

Would it be possible to add this trigger?

I want to prevent the embarrassment of my laptop blurting music in the office if I disconnect / power off my headphones. It has happened quite a few times in the past while. Sometimes I leave my computer with music playing through my headphones. If I accidentally walk away too far, they disconnect, and the audio starts playing over my laptop speakers. In other cases, I leave my headphone on the desk and forget about them due to meetings. After a while they power off because of an empty battery, and again; music / audio blurts through the laptop speakers.

Above examples mainly affect the workplace, which could be covered by the WLAN trigger. However, the same situations can occur at other places, including in places where you don't want to trigger based on WLAN (e.g. at home). Therefore, I think this type of trigger can still be useful.

Really hope you can implement this :)

lx-s commented 2 years ago

Hi Rediwed - that's a great idea! I'll see what I can do, but that should certainly be possible to implement :) The next few weeks will be a bit slow, as holidays start in Bavaria, but I'll try to add it really soon :)

Leaving this here for me later: https://stackoverflow.com/questions/57156863/get-bluetooth-devices-connection-notification

Rediwed commented 2 years ago

Awesome to hear you're excited about this!

Just to add; there's a powershell script that sort of does this, however it is a little bit limited and doesn't include an interface to turn it on/off. Plus, it needs to be actived on each reboot through Activity Manager: https://github.com/PrateekKumarSingh/Posh-AutoMute

Still, might provide some insights on how to implement this technically :)

E: I understand, enjoy your time off!

lx-s commented 2 years ago

E: I understand, enjoy your time off!

Thanks :)

I just started implementing it: https://github.com/lx-s/WinMute/tree/14-new-triggers-auto-mute-on-disconnect-bluetooth-headset The code currently detects when a Bluetooth-Device connects and disconnects and mutes accordingly. UI work and real testing with various Bluetooth-devices still has to be done though.

When I have implemented the UI stuff, I'll upload a beta version here, so you may test it :)

Rediwed commented 2 years ago

Wow! That's really fast. I'd be happy to test it in the real world (= an office😉)

lx-s commented 2 years ago

If you'd like to test the new feature, here you go: WinMute-2.1.0.0-beta1.zip

I've tried it with a few headsets (and also, controllers, since only Audio-Devices should trigger the new muting mechanism) and so far everything worked on my PC :)

Thanks for your help!

lx-s commented 2 years ago

So, I wanted to get this release out of the door, as everything worked for two days now.

You can find it here: https://github.com/lx-s/WinMute/releases/tag/2.1.0.0

If there are any problems, feel free to open a ticket. Thank you very much for your great idea!

Rediwed commented 2 years ago

Hi Alex, sorry about the delayed reply. I've just tested your version 2.1.0 beta, and it works perfectly! It does exactly what I intended with the opening of this issue. This will be PERFECT in-office! It's amazing you got it working so quickly. Thanks a lot!

lx-s commented 2 years ago

Thank you :)

I improved the Bluetooth usability a bit with the 2.1.1 release (e.g. adding a small delay before unmuting when a Bluetooth device reconnects), that should make the feature smoother :)

you can download it here: https://github.com/lx-s/WinMute/releases/tag/2.1.1.0