Storyline 360 In-Story Volume Control Scripts

Jul 13, 2017

Skip to the bottom for the bolded question for TLDR. So I've added continuous, looping background music to my presentation, and added a volume slider to adjust that. This is the script I use to begin the music:

     var player = GetPlayer();
     this.Location= player.GetVar("location");

     var audio = document.getElementById('bgSong');
     audio.src=Location + "Corporate Background.mp3";
     audio.load();
     audio.play();

The slider was connected to a variable called "volumeCount" (from http://www.swiftelearningservices.com/how-to-create-custom-volume-controls-in-articulate-storyline-2/) - and it does not work at all. So instead, I used the regular volume adjustment to match the corresponding volume of the background music to the position of the slider (1-10), and it worked brilliantly for the background music. The script (ex/ for 1) looks like this:

     var audio = document.getElementById('bgSong');
     audio.volume = 0.01;

Unfortunately, this only changes the background music. I tried to incorporate this with the script used from the link above, which is:

     var player = GetPlayer();
     var volumeCount = player.GetVar('volumeCount')
     Audio.setMasterVolume(volumeCount);

and I could not get it to work. I want to connect this slider, in the exact same way, to the master volume of the in-presentation volume (the narration). How do I make this work?!?! I know little to nothing about java.

8 Replies
Donna Westwood

Lukacz, I salute you - you have literally saved my life... I have a project due for delivery tomorrow in SL3, I was using the old method from SL2 - and at the 11th hour realised it was no longer functioning!! Without your fix I would have had to rebuild the entire project from the ground up in SL2 just so one button would work! I owe you a beer! :)

This discussion is closed. You can start a new discussion or contact Articulate Support.