I am trying to write a set of bytes converted from an mp3 file back to an mp3 file to temporarily store in a users mobile device but cannot seem to get the right folder path of where to write to.
I have tried using Directory.GetCurrentDirectory()
, Environment.CurrentDirectory
, and other variations of these to get the current directory but am only getting back null or just one /
, so I'm not sure if I am using these right for this scenario. The only method of getting any path I have found to work is FileSystem.CacheDirectory
which gives /data/user/0/com.companyname.lal/cache/
.
I think if I am just temporarily wanting to store this mp3 file and then delete it soon after it plays this is maybe the right idea using the cache for both Android and iOS. It appears to work, however I cannot find this /data/user/0/com.companyname.lal/cache/
full path of where my android emulator files are located. There is a data
folder but no user
or any of those other subfolders.
Like I said I am ultimately wanting to just write and store this file temporarily on a user's mobile device that I can delete it soon after playing, but for now I need to just figure out how to write the file at all where it can be accessed in code.