Saving Music to the Media Library

In Windows Phone 8 you can now add and remove music files from the user’s music collection with the SaveSong and Delete methods that extend the MediaLibrary class. This allows you to create feature-rich music apps that tightly integrate with the phone’s Music+Videos Hub.

This API is found in the Microsoft.Xna.Framework.Media.PhoneExtensions namespace in the assembly Microsoft.Xna.Framework.MediaLibraryExtensions.dll.

The sample for this section is located in the MediaLibrary directory of the WPUnleashed.Examples project, in the downloadable sample code.

To add a track to the media library, place the file in isolated storage and create an instance of the SongMetadata class to describe the attributes of the track. ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.