Forum Discussion
HoneyTurner
7 months agoCommunity Member
Muting Audio in Timeline
I'm creating a slide that includes a Text 2 Speech introduction, theme music, then Text 2 Speech instructions.
I would like to add a toggle to the page that will allow the user to mute the theme mu...
- 6 months ago
There are multiple ways to detect an audio file name. For now, I’ll focus on one way.
Execute the following JavaScript global function when the timeline starts on this slide:window.muteAudio = function(filename) { var audioElements = document.querySelectorAll('audio'); audioElements.forEach(function(audio) { const audioFileName = audio.src.split('/').pop(); const audioFilePath = `story_content/${filename}`; if (audio.src.includes(audioFilePath)) { audio.muted = !audio.muted; } }); };
- Publish your file to Web.
- Open the published folder and navigate to the story_content directory.
- Copy and paste the exact filename of the audio file you want to control.
Now, you can mute or unmute the specific audio file by executing JavaScript when the user clicks toggle button:
muteAudio('your-audio-file.mp3');
JoseTansengco
7 months agoStaff
Hello HoneyTurner,
Thanks for reaching out!
While we don't have an official Javascript solution to mute audio in Storyline 360, you can check out this thread, which contains solutions from other users that have been well-received by the community.
I'll let other community members jump in in case they have updated Javascript they'd be willing to share!
Related Content
- 3 months ago