While using unity2.6, we had this problem where the audio sound clip would cut out mid-way through playing towards the end of the clip. After upgrading to unity3.X we noticed this continued to happen. Is there any solution / workaround with the new version of unity?
Seems in 3.2 streaming does not work at all for OGG files: once you call WWW.audioClip, you've just got the samples for whatever OGG is so-far downloaded (not much when isReadyToPlay first becomes true!).
The best I've been able to do is this horrible hack (basically reconvert from OGG once the bit that was downloaded is almost finished playing):
var url = "http://www.vorbis.com/music/Epoq-Lepidoptera.ogg";
function Start () {
var www = new WWW(url);
audio.clip = www.audioClip;
while (!www.isDone) {
yield WaitForSeconds(1);
if (audio.time > audio.clip.length-2) {
audio.clip = www.audioClip;
}
}
}
function Update () {
if(!audio.isPlaying && audio.clip.isReadyToPlay)
audio.Play();
}