I'm trying to see if i can get an endless ogg stream to work in unity. what my system is, is to download 10 seconds of the stream, than streaming that while another 10 seconds gets downloaded, then when the other sample ends, the next one continues.
i made this just to see if it could work, i know theres a huge hick-up because as soon as the sound stopped, it will start downloading again. but i didn't get this to work. is there any other way?
private var url = "http://audio-ogg.ibiblio.org:8000/wcpe.ogg.m3u";
function ReadSample () {
var www : WWW = new WWW(url);
yield WaitForSeconds(10.0);
var clip : AudioClip = www.GetAudioClip(true, true, AudioType.OGGVORBIS);
audio.clip = clip;
audio.Play();
}
function Update() {
if(!audio.isPlaying) {
ReadSample();
}
}
↧