- Home /
 
 
               Question by 
               daganunity · Apr 11, 2016 at 03:45 PM · 
                unity 5ioswwwaudiosourcestreaming  
              
 
              IOS Streaming crash
Hello, Im downloading with WWW and streaming the object.
On IOS System if I try to switch scene while streaming, the application crashes.
It dones't happends on Android devices.
Code Example:
 private IEnumerator startSongStreaming(int playerIndex,User user)
     {        
         AudioSource audioSource = GameObject.FindGameObjectsWithTag ("PlayerResultsAudio")[playerIndex].GetComponent<AudioSource>();
         AudioClip myAudioClip = audioSource.clip;
         string url = user.getCurrentGamePerformacePath ();
         www = new WWW (url);
         Debug.Log (playerIndex +  " :" +  www.progress);
         while (www.progress < .1f) {
             Debug.Log ("Streaming WWW PLAYER INDEX: " + playerIndex + " " + www.progress);
             yield return null;
         }
         myAudioClip = www.audioClip;
         Debug.Log (playerIndex +  " CHECKTHIS:" +  www.progress);
         while (!(myAudioClip.isReadyToPlay)) {
             Debug.Log ("IS READY TO PLAY PLAYER INDEX: " + playerIndex + " " + www.progress);
             yield return null;
         }
         //Debug.Log ("TESTME: " + myAudioClip.isReadyToPlay);
         audioSource.clip = www.GetAudioClip(false, true, AudioType.WAV);
         Button listen = GameObject.FindGameObjectsWithTag ("PlayerResultsListenBtn") [playerIndex].GetComponent<Button> ();
         listen.interactable = true;
     }
 
              
               Comment
              
 
               
              Your answer