- Home /
Play a ogg file in Unity3d says “Streaming of 'ogg' on this platform is not supported”
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.
I am having the same issue on iOS trying to play ogg.
Answer by tanoshimi · May 17, 2016 at 05:05 PM
"Use the overloaded GetAudioClip (bool threeD, bool stream) to stream the audio, instead of downloading the entire clip." http://docs.unity3d.com/ScriptReference/WWW-audioClip.html
Your answer
Follow this Question
Related Questions
How can I convert a video to .ogg format and have it play from a web server? 7 Answers
Ogg Stream Live Video 0 Answers
Best practice: URL address for storing streamed music files 1 Answer
How long should a streaming OGG audio take to start playing? 0 Answers
Trying to stream .ogg file in Mac OSX results in error without description 0 Answers