Turning ON or OFF ALL audio in Storyline by using Javascript functionality on a button

Dec 03, 2021

Hi all,

I have this conundrum and I wondered if anyone here can help...

I am building an e-learning module in Storyline and I have a separate navigation layer (that's always visible in the slide) with a toggle button on all the every slide to switch the audio on or off even the audio files are contained in separate layers. These layers are made visible by clicking on buttons on the base layer that make other layers visible containing pictures and text etc and a corresponding layer containing the audio file.

This works on all these slides as there are only a few layers containing the audio files and I have controlled these with triggers etc

BUT... there is one slide with a LOT of layers with buttons that open up separate layers with one an audio file in them. Now I think I can use the same principle as before but there are a LOT of layers with the audio files in them. 

I was thinking of using a lot of triggers on buttons in conjunction with TRUE or FALSE variables etc to control these but it will take AGES especially as I have to get this right with no 2 sound layers playing at the same time!

I don't know if there is a quicker way of doing this BUT... I was wondering if it was possible to use JAVASCRIPT where this same Toggle button on the navigation layer could call one JAVASCRIPT in the player or browser that mutes ALL sounds on this slide and another JAVASCRIPT that switches them back ON!

I was wondering if any of you guys have found a solution?

It has to work in HTML 5 format etc and on an LMS where this module will eventually reside!

Thanks in advance!

 

 

2 Replies
Jürgen Schoenemeyer

in javascript you can use

DS.appState.onToggleVolume();
DS.appState.currentVolume() // get sound volume [0 ... 1]
DS.appState.setVolume(value) // set sound volume value: [0 ... 1]
DS.appState.lastVolume // value: [0 ... 1]

to change the global volume of the storyline player

https://community.articulate.com/discussions/articulate-storyline/mute-audio-using-javascript