locked
Suspending app from VS with BackgroundMediaPlayer stops audio

    Question

  • Was able to repro this in VS on the Background Audio Sample App (http://code.msdn.microsoft.com/wpapps/BackgroundAudio-63bbc319)

    might just be the fault of how the suspend button works in VS as it appears to be fine when I close the app without a debugger attached (and logging indicates it does get suspended), but there might be a real world scenario where this can happen too so wanted to make sure I still raised the issue and hopefully it can be fixed/workaround put in place.

    with VS attached if I hit "suspend" with audio playing the app suspends as expected, but then after a couple of seconds audio stops. The chrome controls still show a "pause" button indicating that the track is playing, background process doesn't get any events that indicate anything happened. Everything seems to think the track is still playing but it isn't. If I hit "pause" it pauses the track and then I can hit play and it picks up from where it stopped.

    Any idea what might be causing this?

    Monday, June 9, 2014 3:46 AM

Answers

  • Background audio apps shouldn't suspend.  It makes sense that if you force suspension on such an app, it will stop playing.  

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, June 9, 2014 1:36 PM
    Moderator

All replies

  • Background audio apps shouldn't suspend.  It makes sense that if you force suspension on such an app, it will stop playing.  

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, June 9, 2014 1:36 PM
    Moderator
  • Is it possible to suspend/terminate the foreground app but keep the background audio task running in Visual Studio? Because this does happen when not debugging (i.e. audio is playing, then I switch back to my app and I get "resuming.." as if it were terminated, but the audio background task didn't terminate).
    Monday, October 6, 2014 4:59 AM