This sample demonstrates how to play audio on Windows Phone 8.1 when your app is not the foreground task.

You can write apps for Windows Phone 8.1 that play audio in the background. This means that even after the user has left your application by pressing the Back button or the Start button, or changes to another app with the task switcher, your app can continue to play audio.

Scenarios for background audio playback include:

The sample consists of a solution that contains 3 projects:

Note  This sample requires Windows 8.1 and Microsoft Visual Studio 2013 with Update 2 or later.

To obtain an evaluation copy of Windows 8.1, go to Windows 8.1.

To obtain an evaluation copy of Visual Studio 2013 , go to Visual Studio 2013 . After you install Visual Studio 2013, update your installation with Update 2 or later.

Related topics

Overview: Background audio (Windows Phone Store apps)

Operating system requirements

Client
None supported
Server
None supported
Phone
Windows Phone 8.1

Build the sample

  1. Start Visual Studio Express 2013 for Windows --> and select File > Open > Project/Solution.
  2. Go to the directory in which you unzipped the sample. Go to the directory named for the sample, and double-click the Visual Studio Express 2013 for Windows Solution (.sln) file.
  3. Press F7 or use Build > Build Solution to build the sample.

Run the sample

To debug the app and then run it, press F5 or use Debug > Start Debugging. To run the app without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.