我使用的是Unity3d 5.3.4f1,我想從直接url中播放ogg文件。目標平臺是Android。在Unity3d中播放ogg文件說:「不支持在此平臺上的'ogg'流式傳輸」
例子: https://upload.wikimedia.org/wikipedia/commons/6/65/Star_Spangled_Banner_instrumental.ogg
我的代碼:
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();
}
我的錯誤:在這個平臺上 '奧格' 的 流不支持 UnityEngine.WWW:get_audioClip()
如何我可以在我的應用程序中播放ogg文件嗎?我必須先下載它嗎?
謝謝。
如果你想回復我,你在答案評論中做的不是在問題中。 – Programmer