title: Play sound in windows phone 8.1 background
body: <p>I am writing an app which require background music. Below is my code which i made after searching different forums.</p>
  
  <pre><code>class AudioPlayer : IBackgroundTask
  {
      private BackgroundTaskDeferral _deferral;
      public void Run(IBackgroundTaskInstance taskInstance)
      {
          _deferral = taskInstance.GetDeferral();
          taskInstance.Canceled += TaskInstance_Canceled;
      }
      private void TaskInstance_Canceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
      {
          _deferral.Complete();
      }
  
      //===========================================================================================================
      public void startTick()
      {
          BackgroundMediaPlayer.Current.SetUriSource(new Uri("ms-appx:///Audio/clock.wav"));
          BackgroundMediaPlayer.Current.Play();
      }
  }  
  </code></pre>
  
  <p>Problem is it doesnt work. No sound from emulator. Please Help!</p>