How to make player death sound effect / hitsound play once when function is called?

Hello, my player keeps looping their death sound / hit sound when they die in game I was wondering how I could make the player death / hit sound only play once. Right now its playing the death / hit sound but it is looping and overlapping rapidly and it’s quite unpleasant to listen to.

   private bool alreadyPlayed;
            public AudioClip SoundToPlay;
            public float Volume;
    
    
    void Die()
    {
        charController.GetComponent<CharacterController>().enabled = false;
        GetComponent<AudioSource>().PlayOneShot(SoundToPlay, Volume);
            alreadyPlayed = true;
            gameOverScreen.SetActive(true);
        
        Debug.Log("You Have Died");
        GetComponent<AudioSource>().Stop();

        //do something here!
        /*GameObject[] enemies = GameObject.FindGameObjectsWithTag("Enemy");
            foreach (GameObject enemy in enemies)
            {
                NavMeshAgent agent = enemy.GetComponent<NavMeshAgent>();
                if (!agent)
                    continue;
                agent.Stop(); */

            

        }

why don’t you put
void Die()
{
if (alreadyPlayed)
return;

charController.GetComponent().enabled = false;
GetComponent().PlayOneShot(SoundToPlay, Volume);
alreadyPlayed = true;