Music library file access

Arezki Saba

New member
Jan 18, 2014
9
0
0
Visit site
Hello everybody !

I've a problem regarding to the Windows Phone Music Library, i'd to know how to get the path of a saved song after executing the "SaveSong" method of the "MediaLibrary" class.

Thanks in advance.

Best regards.
 

Cheeky Ghosty

New member
Jul 23, 2013
108
0
0
Visit site
Hello everybody !

I've a problem regarding to the Windows Phone Music Library, i'd to know how to get the path of a saved song after executing the "SaveSong" method of the "MediaLibrary" class.

Thanks in advance.

Best regards.

Hi Arezki,

Once the song is imported into the Music Library via the SaveSong method, you loose physical access to the file and can no longer obtain the physical path via the file system. You can get the MediaLibrary object and use it to get the Song item, play the song etc however physical path/access to the raw file is not allowed most likely for security reasons, i.e to stop you bundling other stuff in the mp3 file and then parsing the hidden payload out and sharing it between apps etc!

Ghosty
 

Arezki Saba

New member
Jan 18, 2014
9
0
0
Visit site
Ok thanks for the answer ! So I'll explain my problem in details, i've a .wav file in my application, i want to share it with "ShareMediaTask" to send it by Bluetooth or by mail but this file is in the IsolatedStorage so that's impossible to share it, how can i do ?
 

Cheeky Ghosty

New member
Jul 23, 2013
108
0
0
Visit site
Ok thanks for the answer ! So I'll explain my problem in details, i've a .wav file in my application, i want to share it with "ShareMediaTask" to send it by Bluetooth or by mail but this file is in the IsolatedStorage so that's impossible to share it, how can i do ?

I'm pretty sure you can only share stuff from your Apps IsolatedStorage.

Once the .wav is no longer in the app sandbox, you loose the right to share it!
 

Cheeky Ghosty

New member
Jul 23, 2013
108
0
0
Visit site
No you said you have used the SaveSong method to put the file in the MediaLibrary? If it is in the MediaLibrary it IS NOT in the apps IsolatedStorgae. IsolatedStorage is the apps exclusive little sandbox where it gets to save and consume files. Once the .wav has been moved by calling SaveSong, it is no longer in the app's IsolatedStorage and the app loses control over it basically!
 

Arezki Saba

New member
Jan 18, 2014
9
0
0
Visit site
After doing the "SaveSong" method, i still can play my sound with "MediaPlayerLauncher" from the IsolatedStorage, the file is copied, not moved. Before doing "SaveSong" method i can't share the file and after it's the same, the "ShareMediaTask" doesn't work, before and after, so i'm totally blocked.
 

Cheeky Ghosty

New member
Jul 23, 2013
108
0
0
Visit site
After doing the "SaveSong" method, i still can play my sound with "MediaPlayerLauncher" from the IsolatedStorage, the file is copied, not moved. Before doing "SaveSong" method i can't share the file and after it's the same, the "ShareMediaTask" doesn't work, before and after, so i'm totally blocked.

Yea....well your app shouldn't be able to access the physical file from the MediaLibrary anyway so using SaveSong is then irrelevant to what you are trying to do. If it is possible, you will need to work with the file you have in your IsolatedStorage. I haven't shared anything over BT so I'm no help there sorry, but yea forget stuff in the MediaLibrary, as you need to use XNA to utilise it and what you can do with it is limited.
 

Cheeky Ghosty

New member
Jul 23, 2013
108
0
0
Visit site
Ok...That's weird :(
Yep....welcome to the Windows Phone SDK.....where basically all the fantastic things you want to do get reduced to a tiny subset of functionality due to you not actually being able to do much.....and then what you can do is buggy as hell! E.g my app Swipe Tunes, ever since GDR2 the MediaPlayerSongChange event doesn't fire sometimes in production.....I cannot get the bug to happen in development so I can't even build around the bug and test it!.....also background transfer requests not all the exposed events actually work....its pretty crap actually!
 

Members online

Forum statistics

Threads
323,300
Messages
2,243,598
Members
428,055
Latest member
DrPendragon