title: How to stream/download&play an audio from URL?
body: <p>I need to stream or download and play an audio getted from an URL in Unity3D, running on iOS.
  The Audio comes from a text-to-audio service and I need to play it on Unity:</p>
  
  <p><a href="http://api.ispeech.org/api/rest?apikey=...&amp;action=convert&amp;voice=eurspanishfemale&amp;text=hola+que+tal" rel="nofollow">http://api.ispeech.org/api/rest?apikey=...&amp;action=convert&amp;voice=eurspanishfemale&amp;text=hola+que+tal</a></p>
  
  <p>I've been googling all the morning and not found a valid solution...
  There is a code snippet in the Unity3D documentation (<a href="http://docs.unity3d.com/ScriptReference/WWW-audioClip.html" rel="nofollow">WWW-audioClip</a>,<a href="http://docs.unity3d.com/ScriptReference/WWW.GetAudioClip.html" rel="nofollow">WWW.GetAudioClip</a>), but is not working, I have debugged and the error says it couldn't open the file.</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class AudioURLScript : MonoBehaviour {
      public string url = "http://api.ispeech.org/api/rest?apikey=...&amp;action=convert&amp;voice=eurspanishfemale&amp;text=hola+que+tal";
      public AudioSource source;
      void Start() {
          WWW www = new WWW("file://"+url);
          source = GetComponent&lt;AudioSource&gt;();
          source.clip = www.GetAudioClip(false,true);
      }
      void Update() {
          if (!source.isPlaying &amp;&amp; source.clip.isReadyToPlay)
              source.Play();
  
      }
  }
  </code></pre>
  
  <p>Thanks</p>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>This is my working solution right now.</p>
  
  <pre><code>void Start(){
      StartCoroutine(DownloadAndPlay("http://api.ispeech.org/api/rest?apikey=...&amp;action=convert&amp;voice=eurspanishfemale&amp;text=Hola+que+tal"));  
  }
  
  IEnumerator DownloadAndPlay(string url)
  {
      WWW www = new WWW(url);
      yield return www;
      AudioSource audio = GetComponent&lt;AudioSource&gt;();
      audio.clip = www.GetAudioClip(false, true,AudioType.MPEG);
      audio.Play();
  }
  </code></pre>