Can I mute the background music from a random scene? C#

I made a gameobject with a DontDestroyOnLoad function on it in my splash, and I inserted the audio in it, now on my main menu I made a mute button, but I can’t figure a way to make the background music stop or mute, is there anyway to solve this?

If the game object has an AudioSource component, you could try this.
AudioSource.Stop();Or if you just want to mute the volume…

AudioSource.volume=0;

Edit:
Also, if you have multiple AudioSources on the game object and don’t have a variable referencing each AudioSource, you could do something like this to stop/mute.

GetComponents<AudioSource>()[yourNumber].Stop();
GetComponents<AudioSource>()[yourNumber].volume=0;

Nvm, I found a way by making the volume of the AudioListener to 0 and making it to 1 to mute and unmute.