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!
A quick tip:
– phxvyperyield returnwill wait until the entire file is downloaded/loaded into the game. I'm saying this because in your code you useyield return... while in your question you ask how to wait until the download is finished even though your code already does that!