c# - Accessing the Phone's Music in Windows Phone 7 (and 8) -


i'm trying make more intuitive music playing app, question is: how can access music stored on phones music library?

i need information such as: -song name -song artist -song album -track number

is there way so?

the medialibrary class api access mediafiles on phone (pictures, music, ...) can access song-collection following snippet:

using(medialibrary library = new medialibrary()) {     foreach(var song in library.songs)     {         debug.writeline("name: " + song.name);         debug.writeline("artist: " + song.artist.name);         debug.writeline("album: " + song.album.name);     } } 

you can play song:

mediaplayer.play(song); 

reference microsoft.xna.framework.media in project , make sure dispose medialibrary after access.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -