O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required