VERY irritating.... I need help with playing and switching sounds in Javascript code...

Hello, Again, I have two sounds, ok, and one is an intro sound, the other is a looped sound… I want this to happen:

When the scene loads I want the intro sound to play, When that sound is finished playing, I want the second sound to play in a loop.

The problem:

I have not the slightest clue on how to do this :frowning: Please help me :frowning:

Thanks a ton

Fine fine here have a free script.

var startingSound : AudioClip;
var loopingSound : AudioClip;

function Start()
{
    audio.clip = startingSound;
    audio.Play();
    PlayQueued(loopingSound, true);
}

function PlayQueued(next : AudioClip, loop : boolean)
{
    yield WaitForSeconds(audio.clip.length - audio.time);
    audio.clip = next;
    audio.loop = loop;
    audio.Play();
}