Continuous Music Code Issue

LA-Laker
06 Apr 2018, 04:00

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.
06 Apr 2018, 04:46

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

Does the audio need to be looped?


LA-Laker
10 Apr 2018, 04:30

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


K.V.
10 Apr 2018, 05:12
[[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.
10 Apr 2018, 05:21

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]]

LA-Laker
11 Apr 2018, 07:44

Thanks!!