Hi im using UnityWebRequest to load a local audio file from my hard.
string path = "C:\Songs\my_music 3.0+1.01/music.mp3";
using (UnityWebRequest wwww = UnityWebRequestMultimedia.GetAudioClip("file:///" + path, AudioType.MPEG))
{
var synRes = wwww.SendWebRequest();
yield return synRes;
if (wwww.result == UnityWebRequest.Result.ConnectionError)
{
Debug.Log(wwww.error);
}
else
{
Musica.clip = DownloadHandlerAudioClip.GetContent(wwww);
}
}
give me this error:
InvalidOperationException: HTTP/1.1 404 Not Found
UnityEngine.Networking.DownloadHandler.GetCheckedDownloader[T] (UnityEngine.Networking.UnityWebRequest www) (at :0)
UnityEngine.Networking.DownloadHandlerAudioClip.GetContent (UnityEngine.Networking.UnityWebRequest www) (at <2cf75a7170104cfeb19f62c159dcd056>:0)
If i remove manually “+” in the path its work fine.
I tried with UnityWebRequest.UnEscapeURL but just deletes “+” and give me the same error.