Forum Discussion

JamesWHenry's avatar
JamesWHenry
Community Member
3 years ago

Articulate Storyline 360- Music across specific slides - how to stop it?

Hi all.

I know there have been a couple of threads on this topic. The ones I see are more than a couple of years old, from what I can tell, so I am hoping to get a 2022 perspective if possible. I have background audio that I want to initiate on slide 2 and then continue to play until the learner reaches a specific target layer of say, slide 15.

From previous instructions posted on this topic, I have managed to execute the first part of this; my background music is indeed starting when it's supposed to, and continuing across subsequent slides (Woo!, because I really don't know javascript).

The issue I can't yet solve is how to get it to STOP when we reach the target slide. Below is my initial "execute javascript" trigger.

function add_line() {
var line = document.createElement("audio");
var head=document.getElementsByTagName('body')[0];
line.type = "audio/mp3";
line.src="story_content/audio_files/Jeopardy 3 Minute music Mixdown JHenry.mp3";
line.id="bgSong";
line.autoplay = true;
line.loop = true;
head.appendChild(line);
}
if(document.getElementById('bgSong')==null){
add_line();
var audio = document.getElementById('bgSong');
audio.volume = 0.1;
}

 

Can anyone give me the approach and steps to solve this?

18 Replies

  • I suspect your path to the mp3 is false and Storyline cannot find it when added to TalentLMS.

    Do add some console.log() messages into your code and test those on TalentLMS to see whether your path works.

    For example here:

    audioNode.src = "story_content/audio_files/" + audioFileName;
    console.log("source is: "+audioNode.src);

    Make a habit of using the console to debug your code. And learn a bit of Javascript if you use it. Especially how to debug your code.  Sharing your .story also helps.

  • JamesWHenry's avatar
    JamesWHenry
    Community Member

    Hey Math and Jurgen -

    Really appreciate your help, but I think I'm way less technical than you guys imagine, lol. 

    I know nothing about debugging or troubleshooting code or anything like that. But I can follow simple clear steps.

    Here is what "F12" shows me on the Talent LMS page for the module.

    And the .Story file as well

    Thanks for your patience with my lack of coding knowledge!

  • the interesting tab is "Console" and "Network"

    you could open the console windows in an separate window


    but I see you are on scorm (-> scorm_loaderV2.html) => do you have inserted the path to your injected mp3 file to the scorm manifest file "imsmanifest.xml"

     

  • We cannot do much with this as is. Do study a bit about debugging code in the console...all the extra windows you see on the right...  somewhere inthere there will be info on what is wrong. The html you sent...well its not the .story source file...so we cannot do much with that either.