- Home /
How do i stream audio?
I am trying to stream in audio from my website and i can't get it to work. I get a "null reference exception" at line 9. what am i doing wrong?
#pragma strict
var url = "http://d3jasongames.webs.com/ordinary";
function Start () {
var www : WWW = new WWW (url);
audio.clip = www.GetAudioClip(false,true);
}
function Update () {
if(!audio.isPlaying && audio.clip.isReadyToPlay)
audio.Play();
}
Comment
hmmm thats odd, I tried compiling the script and it worked perfectly. Do you have the latest version of unity?
Sorry to bring up an old thread, I get exactly the same null reference error did you resolve it? I am trying to play an internet radio stream through unity.