Problem with AudioListener,Problem with my theme in main menu not playing

When i pause my game with my ingame pause button i have set the AudioListener.pause = true; and the sound stops and when i press my resume button i set AudioListener.pause = false; and my game sound continues. But if i press the main menu button from my pause menu i get back to the main menu but my main menu theme doesn’t start to play? What have i done wrong and what can i do to fix it?,When i press the pause button in my game i pause the whole game and i use AudioListener.pause = true; if i resume the game i set AudioListener.Pause = false; but if i go to my main menu with the button for the main menu and i use AudioListener.pause = false; my main menu music theme refuses to play? what have i done wrong?

I tried to follow this, i think u have the Main Menue in the same Scene right?


So when u call ur Main Menu and u set the Audio Listener to false… its FALSE
the Audio Listener is not ur Audio File. If u want play a different kind of Music/Thema/Sound
in the Main menue then u need to set 2 Audio Sources
so when u make Pause u stop ur Music
but when u open ur Main Menue u want a different kind of Music so u have to Deactivate the Audio from the Game and Activate the Audio from the Menue

u simply can archive this with

public AudioSource gameAudio; // Set in Inspector
    public AudioSource mainAudio; // Set in Inspector
                           // Or set them with Find Object or something this is complete up to you

    public void MainAudio()
    {
        gameAudio.Stop(); 
        mainAudio.Play();
    }

    public void GameAudio()
    {
        mainAudio.Stop();
        gameAudio.Play();

    }

now u can simple use the UnityUI Button with an Onclick Function and then u call this or u make ur own functions and fill this inside


U also can load the Prefabs from Ressources into 1 Audiosource there are some more solutions like with Find and GetComponent when u have multiple Audiofiles that u wanna play after one Sound File is finished