Continuous Music Code Issue

Hello. I got the sound code working. But, I couldn't get the sound to continue until the song fades into the start of "Story Mode". Also, is there another code that plays a different song when the function enters story mode? Thanks.

Here is the code.

[[GAME MENU]]:
@title Game

{GAMESOUND01}

Beta Version

[[Click to Start]](MAIN MENU)

[[MAIN MENU]]:
@clear

Main Menu

Arcade Mode:

[[Story Mode]](Story Mode)

Challenge Mode:

Characters:

Gallery:

Options

[[Story Mode]]:
@clear
@title clear_timeout

STORY MODE

[[Beginning]](New Story)

[[New Story]]:
@clear

The Story begins

[[GAMESOUND01]]:


K.V.

How long does the audio last, and how long does it take to get to story mode?

Does the audio need to be looped?


The audio needs to be looped. If you would help me, please.


K.V.
[[start]]:
    squiffy.ui.write('<audio id="ogg-audio" src="http://media.textadventures.co.uk/games/1RurGHLuLUqrWdMJh53LTQ/bushcave-explicit-r9/sounds/bushcave.ogg" autoplay />');
    squiffy.ui.write("Welcome to the game!");
    squiffy.story.go("loop audio");


[[stop audio]]

[[stop audio]]:
    document.getElementById("ogg-audio").pause();
    document.getElementById("ogg-audio").currentTime=0;
    
[[play audio]]


[[play audio]]:
    document.getElementById("ogg-audio").play();
    
[[stop audio]]


[[loop audio]]:
    document.getElementById("ogg-audio").loop = true;
    
[[stop audio]]

K.V.

To change the audio's source:

[[start]]:
    squiffy.ui.write('<audio id="ogg-audio" src="http://media.textadventures.co.uk/games/1RurGHLuLUqrWdMJh53LTQ/bushcave-explicit-r9/sounds/bushcave.ogg" autoplay />');
    squiffy.ui.write("Welcome to the game!");
    squiffy.story.go("loop audio");


[[stop audio]]:
    document.getElementById("ogg-audio").pause();
    document.getElementById("ogg-audio").currentTime=0;
    
[[play audio]]

[[change src]]

[[play audio]]:
    document.getElementById("ogg-audio").play();
    
[[stop audio]]

[[change src]]

[[change src]]:
    document.getElementById("ogg-audio").loop = false;
    document.getElementById("ogg-audio").src = "http://media.textadventures.co.uk/games/6qJLyNxxokqakBDCUdwE2Q/snd_effect.ogg";


[[loop audio]]:
    document.getElementById("ogg-audio").loop = true;
    
[[stop audio]]

[[change src]]

Thanks!!


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums