我想从扬声器电话播放mp3文件并同时通过麦克风录制。我使用下面的代码将音频从听筒传送到免提电话:
AudioRoutingManager audioManager = AudioRoutingManager.GetDefault();
audioManager.SetAudioEndpoint(AudioRoutingEndpoint.Speakerphone);
但它让我的应用程序崩溃了。我关注此帖http://blogs.msdn.com/b/matthew_van_eerde/archive/2014/03/17/a-mental-model-for-the-windows-phone-audioroutingmanager-api.aspx
答案 0 :(得分:0)
我确实尝试添加此
AudioRoutingManager.GetDefault().AudioEndpointChanged += MainPage_AudioEndpointChanged;
和
private void MainPage_AudioEndpointChanged(AudioRoutingManager sender, object args)
{
AudioRoutingManager.GetDefault().SetAudioEndpoint(AudioRoutingEndpoint.Speakerphone);
}