Loading .wav on iOS with WWW

I am trying to load a .wav using the WWW class. This works fine on Windows (PC) and Android. But on my iPhone 4 the app freezes when calling the method below (it stays in the while loop).

Does someone have an idea about what is going wrong?

private Track LoadTrack(string pathname)
{
	WWW audioToLoadPath = new WWW("file://" + pathname);

	while (!audioToLoadPath.isDone) 
	{
		//Wait untill it's done
	}
		
	Track loadedAudio = Instantiate(TrackInstantiator) as Track;
	loadedAudio.GetAudioSource().clip = audioToLoadPath.GetAudioClip(true, false);

	return loadedAudio;
}

The pathname i am passing is retrieved by something like this (simplified exampe):

DirectoryInfo info = new DirectoryInfo(Application.persistentDataPath);
string pathname = persistentInfo.GetDirectories ()[0].FullName;

Edit:
The path put in the WWW class is:
file:///var/mobile/Applications/APP_GUID/Documents/file3.wav

XCode is not giving me any hints/debug information about this.
Also audioToLoadPath.error is empty.

Other things i have tried:

  • Remove ‘File://’
  • Tried it with ‘File://’ and ‘File:///’
  • Tried ‘File://localhost/var/…’

You should always use coroutine when downloading files using WWW

IEnumerator LoadTrack(string pathname)
 {
     WWW www = new WWW(System.IO.Path.Combine("file://", pathname);
     yield return www;
     if(www.error != null)
     {
          Debug.Log("Couldn't Load file");
     }
     else
     {
          Track loadedAudio = Instantiate(TrackInstantiator) as Track;
          loadedAudio.GetAudioSource().clip = www.GetAudioClip(true, false);
     }
 }



// Start the loading using...
StartCoroutine(LoadTrack(pathname));