Audio is not playing but i don't have any compiler errors?

Will not play, although the audio source does show the clip as being played, i don’t hear it.

#pragma strict





var concreteSound1 : AudioClip [];

var MetalSound1 : AudioClip [];

private var isWalking : boolean = true;

var footstepTime : float = 0.2;

private var isMoving : boolean = false;

private var isJumping : boolean = false;

private var isOnConcrete : boolean = false;

var clipType : String = "";

 

function Update() {

    if (Input.GetAxis("Horizontal")) {

        isMoving = true;

        } else if (Input.GetAxis("Vertical")) {

        isMoving = true;

        } else if (Input.GetButtonDown("Jump")) {

            isMoving = true;

            isJumping = true;

        } else if (!Input.GetButton("Jump")) {

            isMoving = false;

            isJumping = false;
            
          

        } 

        //In order for jump to work, there must be a delay in the time from jump button press to actual jump in order for it to register. Also, ensure GetButtonDown on the player jump script, otherwise, it wont work right.

        else if (!Input.GetAxis("Horizontal")) {

        isMoving = false;

     } else if (!Input.GetAxis("Vertical")) {

        isMoving = false;

     }

}

 

function OnControllerColliderHit (hit : ControllerColliderHit) {

    if (hit.gameObject.tag == "Concrete" && isWalking && isMoving || isJumping && isWalking && isOnConcrete) {

        Debug.Log ("Walking On Concrete");

        isOnConcrete = true;

        WalkOnConcrete();

    } else if (hit.gameObject.tag == "Metal" && isWalking && isMoving || isJumping && isWalking) {

        Debug.Log ("Walking On Metal");

        isOnConcrete = false;

        WalkOnMetal();

    }

}

 

function WalkOnConcrete() {

    var concreteToPlay : GameObject = GameObject.FindWithTag ("Concrete");

    isWalking = false;

    yield WaitForSeconds (footstepTime);

    audio.clip = concreteSound1 [ Random.Range(0, concreteSound1.Length) ];

    clipType = "concreteSound1";
  
    isWalking = true;

}   

 

function WalkOnMetal() {

        var MetalToPlay : GameObject = GameObject.FindWithTag ("Metal");

    isWalking = false;

    yield WaitForSeconds (footstepTime);

    audio.clip = MetalSound1 [ Random.Range(0, MetalSound1.Length) ];

    clipType = "MetalSound1";
   
    isWalking = true;

}

For most purposes, it’s actually best to use 2D sound instead of 3D sound.

Check the import settings on your audioclip, and make sure that ‘3D sound’ is unchecked.

Assuming you left settings default, the 3D sounds don’t have a big enough range to reach the audiolistener that is sitting on the Main Camera.