how to play audio through earpiece only in windows phone 8 application

纵然是瞬间 提交于 2019-11-29 07:39:12
Patrick F

The APIs in the Windows.Phone.Media.Devices namespace require the ID_CAP_AUDIOROUTING and the ID_CAP_VOIP capability. (Add this to your manifest)

Also, it's only possible to change the audio routing while in a active VOIP call.

Additionally, you need to do the audio routing in your background VOIP process, and not in the foreground process.

Old question but now I know the answer.

Two things which you need to do: 1. Tag the audio in question as "communications"

How to do this depends on what API you're using. It could be as simple as . Or you might have to call IAudioClient2::SetClientProperties with an AudioClientProperties structure whose AudioClientProperties.eCategory = AudioCategory_Communications.

  1. Tag your app as either a "voice over IP" app or a "voicemail" app You should add file called WindowsPhoneReservedAppInfo.xml to your project with the following contents:

    <?xml version="1.0" encoding="utf-8"?>
    <WindowsPhoneReservedAppInfo         xmlns="http://schemas.microsoft.com/phone/2013/windowsphonereservedappinfo">
      <SoftwareCapabilities>
        <SoftwareCapability Id="ID_CAP_VOIP" />
      </SoftwareCapabilities>
    </WindowsPhoneReservedAppInfo>
    

Look for more detailed explanation here:

Playing audio to the earpiece from a Windows Phone 8.1 universal app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!