Hello,
I need to load external mp3 files and i don`t need to stream it.
Using WWW class:
// Use this for initialization
void Start () {
StartCoroutine(LoadMp3("file://C:/Users/Cristian/Music/Cera.mp3"));
}
// Update is called once per frame
void Update () {
}
IEnumerator LoadMp3(string url) {
WWW m_get = new WWW(url);
yield return m_get;
GetComponent<AudioSource>().audio.clip = m_get.audioClip;
audio.Play();
}
But it returns this error message: “Streaming of ‘mp3’ on this platform is not supported”
Is there a way to wait the download of entire file and after play it?
Thanks!
Unity doesn’t support streaming (or) loading MP3 files on WebPlayer and windows standalone. However it supports on mobile platforms. As an alternative you can convert your mp3 file to .ogg format and I think you code will work as expected.
You can use AudaCity to convert mp3 to ogg.