Countdown Sound Not Playing!!

I have set up a counter to display a “3, 2, 1, GO”. Once it’s running and counting down, no sound plays fully until it gets to the end of the If and Else statement. Here’s the script I’m using:

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class countDown : MonoBehaviour {

    // Use this for initialization
    void Start () {
   
    }
   
    public AudioSource cdSound1;
    public float timeLeft = 4f;
    public Text displayText;
    public float checker;

    void countdownSound() {
        if (timeLeft >= 3) {
            displayText.text = "3";
            cdSound1.Play(0);
        } else if (timeLeft >= 2) {
            displayText.text = "2";
            cdSound1.Play(0);
        } else if (timeLeft >= 1) {
            displayText.text = "1";
            cdSound1.Play(0);
        } else if (timeLeft >= 0) {
            displayText.text = "G O";
            cdSound1.Play(0);
        }
    }

    // Update is called once per frame
    void Update () {
        timeLeft -= Time.deltaTime;
        countdownSound();
    }
}

Looks like you are doing the if/else check in countdownSound() every frame because it’s being called from Update. That means that cdSound1.Play(0) is being called every frame where one of those conditions is true. Also, the way you’ve constructed the if-conditions means that they will return true in sequence ex: if timeLeft == 2.5f then all but the first first if-statement will return true one after the other, every frame. That would explain why no sound plays fully until the very last call to cdSound1.Play(0);

Try implementing the countdown with integer values and a call to InvokeRepeating(), and do some checks for equivalence/starting playback in the repeating function!