Hola,
Is it still true that Unity's built-in audio player can't play audio from the /Documents folder in iOS?
So I'd still have to use AVAudioPlayer?
ty
Hola,
Is it still true that Unity's built-in audio player can't play audio from the /Documents folder in iOS?
So I'd still have to use AVAudioPlayer?
ty
Julian,
I am loading ogg-vorbis formated files from the documents folder on my iPad and iPhone. I did this so my Audio engineer would be able to update sounds in my game while in development so I would not have to do a new build each time he wanted to change the audio clips.
Contrary to what the Unity web site (documentation) states, ogg-vorbis files seem to work just fine on iDevices when loaded via WWW. It is wav that cannot be loaded via WWW.
Here's a code snippet for you
var www : WWW = new WWW("file://" + docPath + localPath);
yield www;
if(www.error == null){
print("Loaded local bundle - instantiating :: " + www.assetBundle.mainAsset.name);
Instantiate(www.assetBundle.mainAsset, Vector3(0, 0, 1.5), Quaternion.identity);
print("INSTANTIATED FROM LOCAL");
}
As far I know it should work.
how did you load ogg files from documents folder?
this is what i tried.
.........
www = new WWW("file:///var/mobile/Applications/6832F66D-DC62-40A1-A026-2436F6479CE1/Documents/song.ogg");
if (www == null)
return null;
return www.oggVorbis;
...........