The creation of the toggle button didn’t work quite as well as I had presumed. On init I called the ambient loop to play however I didn’t do this through the toggle function. I called the original sound to play on init so when the toggle button is pressed to stop the track, it starts another version of the ambient track to play simultaneously instead. This was a simple fix in the end even though it took me a while to figure it out. Instead of calling the play sound function I simply called the toggle function on init as an alternative.