c# - Import file to Isostore WP8 -


how copy song windows phone music library isolated storage of app?

i need convert each song wav file format.

edit 1: tried

private async void importmedialibrary() {     try     {         var sourcefile = await package.current.installedlocation             .getfileasync("music/05 beat it.mp3");         copyfileintoisostore(sourcefile);     }     catch (exception e)     {         system.diagnostics.debug.writeline(e.message+"\n"+e.stacktrace);     } }  private async void copyfileintoisostore(storagefile sourcefile) {     using (var s = await sourcefile.openreadasync())     using (var dr = new datareader(s))     using (var isostore = isolatedstoragefile.getuserstoreforapplication())     using (var targetfile = isostore.createfile(sourcefile.name))     {         var data = new byte[s.size];         await dr.loadasync((uint)s.size);         dr.readbytes(data);         targetfile.write(data, 0, data.length);     } }   

but i've error :

value not fall within expected range.    @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task)    @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task)    @ system.runtime.compilerservices.taskawaiter`1.getresult()    @ stretchandshift.mainpage.<importmedialibrary>d__0.movenext() 

but file in right location... , import file music folder, without giving path "music/05 beat it.mp3"


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -