cit*_*lao 3 windows windows-runtime windows-11
Windows 22H2 引入了一个新的热键(Win+Alt+K[请参阅“Windows 徽标键快捷方式”下的Windows 中的键盘快捷方式])来使呼叫静音。对应任务栏中的UI:
当我使用 Teams 时它有效,但当我使用 Mumble 时它不起作用:
快捷方式指南表明它在 Windows 11 22H2 中适用于支持“呼叫静音”的应用程序:
在支持呼叫静音的应用程序中切换麦克风静音。从 Windows 11 版本 22H2 开始可用。
我需要使用哪些 API 才能支持这个新热键?
免责声明:我在微软工作。
要在您自己的应用程序中支持通用静音按钮,需要执行 2 个步骤:
VoipPhoneCall使用 .创建一个新的VoipCallCoordinator。VoipCallCoordinator.MuteStateChanged事件并触发相应的NotifyMuted或函数。NotifyUnmuted例如:
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();
Run Code Online (Sandbox Code Playgroud)
有关完整的 C# 演示,请参阅https://github.com/citelao/Universal-Mute ;有关实现此功能的插件,请参阅https://github.com/citelao/mumble-universal-mute/releases/tag/v0.0.1为了曼布尔。
| 归档时间: |
|
| 查看次数: |
572 次 |
| 最近记录: |