trouble loading file with www on the hololens after writing during runtime
Hi guys/gals, I can't get unity to load a file that exists on the Hololens app's local persistent storage. I call the following code after I downloaded a new file and saved it to my device. Here's my code: (of course I'm starting the coroutine and passing the filename parameter)
StartCoroutine(GetClip(fileName));
IEnumerator GetClip(string fileName)
{
if (File.Exists(GetFilePath(fileName)))
{
Debug.Log(fileName + " clip found in resources folder, playing that");
return true;
using (WWW www = new WWW("file:///" + GetFilePath(fileName)))
{
yield return www;
if (www.error!=null){
Debug.Log("www error is: " + www.error);
Debug.Log("www says: " + www.text);
}
else{
audioSource.clip = www.GetAudioClipCompressed(false, AudioType.OGGVORBIS);
Debug.Log("Playing clip" + fileName);
}
}
audioSource.Play();
}
}
private string GetFilePath(string fileName)
{
Debug.Log("Returning path: " + Path.Combine(Application.persistentDataPath, fileName));
return Path.Combine(Application.persistentDataPath, fileName);
}
My output is:
Returning path: C:/Data/Users/andre/AppData/Local/Packages/MixedRealityToolkit-Unity_zbb2d34ez0get /LocalState\greetings%21.ogg greetings%21.ogg clip found in resources folder, playing that www error is: 404 Not Found www says:
Also: I've logged onto the hololens file explorer and the file is there and I can play it on my media player, so it should work!~~
Your answer
Follow this Question
Related Questions
AdControl and Unity C# Projects 0 Answers
Reading data from persistent data path (error UnityBlockWWWConnectionIsDone) for ios 0 Answers
WWW class Windows Store 0 Answers
www class download local file (Windows Universal Platform - Hololens) 1 Answer
Porting Android -> WindowsPhone throws Ionic.Zip.dll Reference Rewiter Errors 0 Answers