Opposite of isPlaying for AudioSource?

I have button I want to toggle my music on and off. However I don’t know how to check if the AudioSource is NOT playing. I tried to use “.isPlaying == false” as well.

case (3):
                if (MusicPlayer.GetComponent<AudioSource>().isPlaying)
                {
                    MusicPlayer.GetComponent<AudioSource>().Pause();
                }
                if (MusicPlayer.GetComponent<AudioSource>().!isPlaying)
                {
                    MusicPlayer.GetComponent<AudioSource>().UnPause();
                }
                break;

I believe you need to do

if (!MusicPlayer.GetComponent<AudioSource>().isPlaying)

You could also simply do an else statement. You don’t actually need to check if it’s false. Because there are only two options. It’s either playing or it’s not.

if (MusicPlayer.GetComponent<AudioSource>().isPlaying)
                {
                    MusicPlayer.GetComponent<AudioSource>().Pause();
                }
               else
                {
                    MusicPlayer.GetComponent<AudioSource>().UnPause();
                }

Oh geez why did I not think of trying an else statement? Duh! Thanks so much.