Hi all,
Im using unity 2017 and well for now I cant upgrade, but I have been trying to do this for a while and cant. The issue is simple, I want the user to place a file called “sound.wav” in the device’s downloads folder, and just load in the app and play it. I have been trying with WWW but I manage odd results, sometimes the app crashes and other times nothing happens, but not even error seems to be thrown so Im a bit lost, here is the code I have so far, its only a program that loads the wab for now but according to documentation it should work.
void Awake ()
{
audioLoader = new WWW("file:///sdcard0:/"+GetDownloadFolder()+"/sound.wav");
while (!audioLoader.isDone)
System.Threading.Thread.Sleep(100);
sound = audioLoader.GetAudioClip(true, false);
while (sound == null)
{
System.Threading.Thread.Sleep(100);
}
audss.clip = sound;
}
public void clickplay()
{
audss.Play();
}