Help with playing audio thing

Hey people, I need help on making an audio source. I have gotten a script from a youtube video, which I have modified to my needs, it a player vitals script, and I need help making it so a sound plays when the hunger goes below 40 or something. This is what I’ve got.

if (hungerSlider.value <= 70)
{
GetComponent().clip = HeartBeating;
GetComponent().Play();
}

assuming you don’t want it to start from the beginning every frame, have a look at the “isPlaying” attribute