Audiosource reseting for no reason...

Hey everyone,

I am having a really weird problem. An audiosource in my game is randomly resetting its time to 0 in the middle of playing.

curClip_prev.clip = curClip.clip;
curClip_prev.Play();
curClip_prev.time = Mathf.Min(curClip.time, curClip_prev.clip.length - 0.0000001f);

After that I set curClip to a new clip and start it from the beginning. This is all part of a semi complicated music controller to handle transitioning between start clips and looping clips and whatnot. This pattern works in general, and after this runs everything is correct (curClip_prev.time is what I would expect). In fact, on the next Update loop (this is done in Update) curClip_prev.time is still correct, but on the one following that it has magically reset to 0 even though its not looping, and wasn’t at the end of the clip.

Any ideas/anyone run into this before? Seems to be happening outside of my code entirely, which is making this really difficult to fix.

-Sean

As usual, I figured out the issue after posting the question. This only happens if the load-type of the clip is Streaming. Other loadtypes work fine. I’m guessing there is something screwy with the streaming mode that can cause a reset when doing something like I’m doing.

Are you streaming from WWW?