How to detect the audio endpoint device in Windows Phone 8 App ?

This blog post will explain how to detect the audio endpoint device that is connected to the Windows Phone 8 device .

How to detect the audio endpoint device in Windows Phone 8 App ?

The Windows Phone 8 SDK provides the VOIP AudioRoutingManager API which can be used to determine the connected audio endpoint device.

The AudioRoutingManager has the method GetAudioEndpoint which returns the AudioRoutingEndpoint . The AudioRoutingEndpoint is a enum which contains one of the values (Earpiece,Speakerphone,Bluetooth,WiredHeaset,WiredHeadsetSpeakerOnly,BluetoothWithNoiseAndEchoCancellation,Default).

image

Here’s a codesnippet to get the audio endpoint device that is connected.

AudioRoutingEndpoint current = AudioRoutingManager.GetDefault().GetAudioEndpoint();           
MessageBox.Show(current.ToString());

image

Note that you need to add the ID_CAP_VOIP capability in your WMAppManifest file or else you will receive the following error when trying to access the endpoint.

image

An exception of type ‘System.UnauthorizedAccessException’ occurred in MobileOSGeekApps.DLL but was not handled in user code

Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

This blog post will guide you through several effective methods to troubleshoot and resolve the issue of Microsoft Edge not...
Windows 11 offers a range of audio enhancements that can enrich your listening experience. These enhancements include features like virtual...
Windows 11 brings a fresh and visually stunning design to your desktop, and one of the standout features is the...