locked
Audio in MediaElement reverts back to full volume after incoming call is picked up

    Question

  • Hi,

    I have a Windows 8 XAML application which plays music in a BackgroundCapableMedia MediaElement. When an incoming Skype call arrives, the sound lowers considerably (as expected), but when I pick up the call, the music unexpectedly reverts to full volume. If I compare to the Music app included in Windows 8, it continues playing at reduced volume (although personally I would expect it to pause for the duration of the call). I tried looking at all the available documentation and samples, but it seems I'm already doing all the required steps.

    I had the impression that all this was managed automatically by Windows through the different AudioCategories, but I have no proof that at least Windows tried to pause media when a call is picked up. This leads me to a question: is there a way to detect an incoming call in order to pause the currently playing media?

    Thanks,

    Pedro

    Wednesday, November 12, 2014 1:05 PM

Answers

All replies

  • Hello Pedro,

    You can register for the SystemMediaTransportControls.PropertyChanged event when you receive the SoundLevel property in this event's arguments you can check the SystemMediaTransportControls.SoundLevel and check if the property is set to "Low" or "Muted". When it is you can pause your playback.

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, November 12, 2014 11:57 PM
    Moderator
  • Hello James,

    I had tried this, but found the class to be unreliable: it works the first time around, but subsequent calls don't cause PropertyChanged events to be raised. I started wondering if I was missing some other mean to detect incoming calls.

    Thanks,

    Pedro

    Monday, November 24, 2014 5:54 PM
  • Hello Pedro,

    Using SystemMediaTransportControls.PropertyChanged is the recommended way to handle audio volume changes for your app. I'm not sure why you are not getting the PropertyChanged event for subsequent calls. This should work as documented.

    -James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, December 01, 2014 8:58 PM
    Moderator