title: how to play audio through earpiece only in windows phone 8 application
body: <p>I have tried with AudioRoutingManager class...but i got unauthorizedaccess exception.
  here is my code</p>
  
  <pre><code> AudioRoutingManager audioRouting = AudioRoutingManager.GetDefault();
      public AudioRoutingEndpoint ChangeAudioRoute()
      {
  
         var currentEndPoint= audioRouting.GetAudioEndpoint();
         switch (currentEndPoint)
         {
             case AudioRoutingEndpoint.Earpiece:
             case AudioRoutingEndpoint.Default:
                 return AudioRoutingEndpoint.Speakerphone;
  
             case AudioRoutingEndpoint.Speakerphone:
                 return AudioRoutingEndpoint.Earpiece;
  
                 default:
                 throw new OperationCanceledException();
         }
      }
  
      public void SetAudioRoute()
      {
          audioRouting.SetAudioEndpoint(this.ChangeAudioRoute());
      }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/2vjyf.png" alt="enter image description here"></p>