Twine Version: 2.3.9
Story Format: 3.1.0
I have some code that plays music at the beginning of my game, which looks like this:
<script>
var audio = document.createElement('audio');
audio.src = '$URLto.mp3file';
audio.loop = true;
audio.play();
</script>
And it works perfectly. It plays the music on an infinite loop. The question I have is what code do I use to pause the song? I want to change the music at a certain point in the game, but If i use this code again it just plays the new music over the old one. How do I pause/stop the old music so I can play the new audio?