How can I play audio before moving to a new level?

I am trying the following:

void OnTriggerEnter() {
    audio.PlayOneShot();
    Stopwatch stopwatch = Stopwatch.StartNew();
    renderer.material.color = Color.blue;
    while (true) {
        if (stopwatch.ElapsedMilliseconds >= 3000) {
           break;
        }
        Thread.Sleep(10);
    }
    Application.LoadLevel("AverageLoading");	
}

This is what I tried but it just goes straight to the AverageLoading level without
playing any audio. Can someone give me advice with this?

Use Coroutine instead. So you do something like this. (Syntax might need some edits)

void OnTriggerEnter() {
    audio.PlayOneShot(); 
    StartCoRoutine(WaitUntilAudioPlays)
}

IEnumerator WaitUntilAudioPlays()
{
  yield return (new WaitForSeconds(3));
  Application.LoadLevel("AverageLoading");  
}