Search code examples
c#windows-10uwpwindows-10-mobilewindows-10-universal

How to detect unplugged headphone jack in a UWP app?


Is there a way to get notified whenever a headphone jack is unplugged in a UWP app? I would like to do it without programming with low level APIs (i.e: WASAPI).


Solution

  • I believe this is what you are looking for:

    https://msdn.microsoft.com/en-us/library/windows.phone.media.devices.audioroutingendpoint.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1

    https://msdn.microsoft.com/en-us/library/windows/apps/jj662949.aspx