Search code examples
c#.netaudiouwpnaudio

How To Pause All The Sounds Of The System When The Call Is Connected


I want to create an UWP app which should pause the all the sound of my Windows system when there is call is connected in the Google meet, Zoom etc.

How to do this by using C#.


Solution

  • Just from UWP side, UWP apps are running in sandbox which are isolated from system, it cannot access other app's process and is restricted when accessing system resources. So, you can't pause Windows system sound from UWP.

    But there is a solution, you can use Desktop-bridge to start a desktop application, call Win32 API keybd_event with VK_MEDIA_PLAY_PAUS to simulate pause key input. You can refer to Stefan Wick's blog UWP with Desktop Extension – Part 2