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
Post a Comment