Dont destroy on load

Hello, i have this problem
im using

void Awake()
    {
        DontDestroyOnLoad(transform.gameObject);
    }
}

Im using it to dont destroy music on load for scene 1 and 2.
My question is - how can i destroy this music from scene 1 and 2 when i start scene 3 thank you…
And sorry for my english…

Why don’t you use it in the start method?

Also, you’re sending the transform of the gameobject as parameters to not be destroyed, I think you should be sending the object itself.

i tryd this script, but i still plays the same music on level3

{
    static bool AudioBegin = false;
    void Start()
    {
        if (!AudioBegin)
        {
            GetComponent<AudioSource>();
            DontDestroyOnLoad(gameObject);
            AudioBegin = true;
        }
    }
    void Update()
    {
        if (Application.loadedLevelName == "leve3")
        {
            GetComponent<AudioSource>();
            AudioBegin = false;
        }
    }
}

ok fixt it.
thank you

how to fix, you can help me, thank you, you use code

???