Home>

I work with Windows Phone 8. You need to get the path to the audio file. For an image, this is done simply.

picturecollection pictures= library.pictures;
Picture SinglePICT= Pictures [index];
path= singlepict.getpath (). Tostring ();

But for the audio there is no such function. Therefore, I am trying to use the MediaLibraryExtensions library. And there is the GetPathFromToken method, which allows you to get the path to the media file. I'm trying to do as follows:

Songcollection Songs= Library.songs;
Song Singlesong= Songs [index];
name= singlesong.name;
path= library.getPathFromToken (Name);

But nothing comes out. If anyone knows, tell me what you need to pass into the parameter.

  • Answer # 1

    Token -This value identifies the specific file you get if the user has chosen the command Share. or Edit. For a media element (picture, song, etc.), and your application knows how to process these commands (see Extensions in the application manifest), or if the user opens the file, and your application can process this type of file. The token value is the usual GUID to which the OR compares a specific file for a particular path.

    So in your example you will not be able to get the path to the file.

  • Answer # 2

    Token -This value identifies the specific file you get if the user has chosen the command Share. or Edit. For a media element (picture, song, etc.), and your application knows how to process these commands (see Extensions in the application manifest), or if the user opens the file, and your application can process this type of file. The token value is the usual GUID to which the OR compares a specific file for a particular path.

    So in your example you will not be able to get the path to the file.