Forum Discussion
Audio on States - is there a way to stop it
- 2 years ago
Try creating a T/F variable called togAudioPauseAll.
Then create an Execute JavaScript trigger and inserting the following code:
const audioList = document.querySelectorAll("audio");for (let i = 0; i < audioList.length; i++) { audioList[i].pause(); }Set this trigger to fire when togAudioPauseAll changes.
Whenever the user clicks a new box/button/whatever, use an Adjust Variable trigger to toggle togAudioPauseAll.
This should stop all playing audio on the slide. Doing this before playing another audio clip lets you kill whatever audio is playing before the new one starts. It avoids having to create a bunch of individual triggers.
A simple way to control multiple audio clips is to put each one on its own layer. When a trigger shows one layer, the default setting in Slide Layer Properties is to hide other layers. That "turns off" the audio on the hidden layer.
Related Content
- 5 months ago
- 12 months ago