Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I support Call Mute (Universal Mute) in my app for Windows 11 22H2?

Windows 22H2 introduces a new hotkey (Win+Alt+K [See Keyboard shortcuts in Windows under "Windows Logo Key shortucts"]) to mute calls. It corresponds to this UI in taskbar:

Microphone usage button in taskbar

It works when I use Teams, but not when I use Mumble:

No supported apps in use for mic mute

The shortcuts guide indicates that it's available in Windows 11 22H2 for apps that support "Call Mute":

Toggle microphone mute in apps that support Call Mute. Available starting in Windows 11, version 22H2.

What APIs do I need to consume in order to support this new hotkey?

Disclaimer: I work for Microsoft.

like image 799
citelao Avatar asked Nov 16 '25 15:11

citelao


1 Answers

There are 2 steps needed to support the Universal Mute button in your own apps:

  1. Create a new VoipPhoneCall with the VoipCallCoordinator.
  2. Handle the VoipCallCoordinator.MuteStateChanged event and fire the appropriate NotifyMuted or NotifyUnmuted function when your app has muted/unmuted in response.

For example:

using Windows.ApplicationModel.Calls;

var coordinator = VoipCallCoordinator.GetDefault();
coordinator.MuteStateChanged += (e, args) => {
    Console.WriteLine($"Mute changed! - {args.Muted}");

    // Respond that the app has muted/unmuted.
    if (args.Muted) {
        coordinator.NotifyMuted();
    } else {
        coordinator.NotifyUnmuted();
    }
};

// No change until you press enter here:
Console.WriteLine("Press Enter to 'start' a call. Ctrl-C to exit.");
Console.ReadLine();

var call = coordinator.RequestNewOutgoingCall("context_link_todo", "Satya Nadella", "DummyPhone", VoipPhoneCallMedia.Audio);
call.NotifyCallActive();

// Win-Alt-K will display your app muted/unmuted until you press enter:
Console.WriteLine("Press Enter to 'end' the call.");
Console.ReadLine();
call.NotifyCallEnded();

See https://github.com/citelao/Universal-Mute for a full C# demo and https://github.com/citelao/mumble-universal-mute/releases/tag/v0.0.1 for a plugin that makes this work for Mumble.

Mic unmuted (DummyPhone) popup

like image 181
citelao Avatar answered Nov 18 '25 12:11

citelao



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!