I’m using Unity3d 5.3.4f1 and I want to play a ogg file from a direct url. Target platform is Android.
Example: https://upload.wikimedia.org/wikipedia/commons/6/65/Star_Spangled_Banner_instrumental.ogg
My code:
public void PlayAnthem()
{
WWW wwwAnthem = new WWW(AnthemURL);
StartCoroutine (WaitForRequestplay (wwwAnthem));
//This works:
// AudioAnthem.clip = Resources.Load ("Japan") as AudioClip;
// AudioAnthem.Play ();
}
private IEnumerator WaitForRequestplay(WWW www){
yield return www;
AudioAnthem.clip = www.audioClip;
AudioAnthem.Play();
}
My error: Streaming of ‘ogg’ on this platform is not supported UnityEngine.WWW:get_audioClip()
Also, I tried UnityEngine.WWW:GetAudioClip(Boolean, Boolean, AudioType)
and I received the same error: Streaming of ‘ogg’ on this platform is not supported UnityEngine.WWW:GetAudioClip(Boolean, Boolean, AudioType)
How can I play a ogg file in my app? Do I have to download it before?
Thank you.