Hey everybody. I'm using UniFileBrowser plugin which returns a file and the path name. All I want to do is use this path to load and play a wav file on iOS. I've been working on this for 18hrs straight, googling www class, posting in other forums, etc. I am desperate for help. Can someone please show me the correct way to write this? It's not returning any errors, but it's also not loading and playing the file...
void OpenFile (string pathToFile) { //OpenFile is apublic funtion of UniFileBrowser
var fileIndex = pathToFile.LastIndexOf (pathChar);
message = "You selected file: " + pathToFile.Substring (fileIndex+1, pathToFile.Length-fileIndex-1);
Fade();
WWW AudioToLoadPath = new WWW("file://" +pathToFile);
Camera.main.audio.clip = AudioToLoadPath.audioClip;
Camera.main.audio.Play();
}
Once I select the file, it returns the name of the file I selected, so that part is working great. I just need help with the correct syntax or how to actually load and play the .wav using the pathToFile.
Thanks all!
↧