Start ambient audio tracks at random points?

I was looking for a way to initialize my ambient tracks at random points so that when each scene loads they don’t sound exactly the same every time.

I searched all over but couldn’t find any similar questions to this problem on unity answers… but then I eventually figured it out on my own. Very simply once I understood how to use audio.time. Here is my code;
Please give alternative solutions if you they are better

var soundToPlay : AudioSource;

var randomStartingTime;

function Start(){

randomStartingTime = Random.Range(0.0, 780.0);



function PlaySound(){

soundToPlay.time = randomStartingTime;



function Update(){

//print  (soundToPlay.time);


You can also just mute tracks instead of stopping them, although I wouldn’t do this with a very large amount of tracks for performance reasons.