I want to play an mp3 file from speaker phone and record by microphone simultaneously. I used the code below to route an audio from earpiece to speakerphone:
AudioRoutingManager audioManager = AudioRoutingManager.GetDefault();
audioManager.SetAudioEndpoint(AudioRoutingEndpoint.Speakerphone);
but it made my app crash. I follow this post http://blogs.msdn.com/b/matthew_van_eerde/archive/2014/03/17/a-mental-model-for-the-windows-phone-audioroutingmanager-api.aspx