Here is another problem aside from (WEB_GL) WWW.GetAudioClip not work with "ogg" both Firefox and Chrome - Unity Engine - Unity Discussions
As .ogg is not work on WEBGL, so I decide to use mp3 instead, and now there is no error about not support mp3 on this platform things… but!!!
The audio file that I got only play for the first 2 seconds. And the rest is gone, and the downloading time is pretty quick for a 3mbs mp3 file too. I try to check the www.progress but it’s appear that the www.progress value is 1 (100%) and also isDone is true…but actually it’s not true
I check the length and the samples and both are actually 0
Here is my code use to download mp3
private IEnumerator downloadMP3(string url, Action callback)
{
WWW www = new WWW(url);
yield return www;
if (www.isDone && string.IsNullOrEmpty(www.error))
{
AudioClip audioclip = [www.GetAudioClip(false,false](http://www.GetAudioClip(false,false), AudioType.MPEG);
Debug.Log("Progress : " + www.progress + “\n” + " Length(S) : " + audioclip.length + " Sample : " + audioclip.samples);
callback(audioclip);
}
else
{
Debug.Log(“An error occurred while downloading.”);
}
}
Is there any problem with the memory things? Or do I get things wrong? Now I’ve tried everything but it’s still doesn’t work. Somebody please help. ![]()