Search code examples
uwpwindows-store-appswin-universal-appwindows-mobile

How do we detect audio end point changing in a Windows Store app?


For WINDOW UNIVERSAL APP, I want to detect whener audio end point is changed.

  • For Windows Mobile App, I used Windows.Phone.Media.Devices.AudioRoutingManager to get the callback and do audio stream routing.

  • For Windows Desktop App, MMDevice API may come in hand.

  • For Windows Store App, I don't know how to get this. How to detect this?

    Any help and useful suggestion is appreciated. Thank you.


Solution

  • After long searching and making reveral test, I think creating a DeviceWatcher is the most relevant solution for this. I tried it and get notifications whenever any headphone/mic is added or removed as well.

    After creating the watcher, you will receive the following notifications for any device that matches your provided criteria.

    • Add notification when a new device is added.
    • Update notification when a property you are interested in is changed.
    • Remove notification when a device is no longer available or no longer matches your filter.

    This is the link refer to it.