This answer should be enough for what you are trying to do:
http://stackoverflow.com/a/23041512/1537726
Question
I am creating an app for music player, but in my Emulator there are no music files
So I decided to add few songs in MediaLibrary
I wrote following code to add songs:
public void addsong()
{
try
{
Uri songUri = new Uri("../Assets/samplemusic/02 Can't Remember to Forget You (feat. Rihanna).mp3", UriKind.RelativeOrAbsolute);
//SaveFileToIsolatedStorage(songUri, "test.mp3");
MediaLibrary lib = new MediaLibrary();
SongMetadata metadata = new SongMetadata
{
GenreName = "Super Hit Songs",
Name = "Song 1",
AlbumName = "My Collections",
AlbumArtUri = new Uri("ApplicationIcon.png", UriKind.RelativeOrAbsolute)
};
MediaLibraryExtensions.SaveSong(lib, songUri, metadata, SaveSongOperation.CopyToLibrary);
}
catch (Exception ex)
{
}
}
but it is not working, I don't know why
Anyone have an idea?
Solution
This answer should be enough for what you are trying to do:
http://stackoverflow.com/a/23041512/1537726