Forum Discussion
Background Audio Cool Trick
Hi All,
Just wanted to share a way to add audio across all slides in Storyline 2 There are a few posts on here about this, and I found this method to be super simple.
**Please note that this is just a cool trick, and not a built in feature of Storyline 2.
Publish your course, open the story.html file with Notepad, scroll to the bottom and add this code
<audio src="YOURAUDIOHERE.mp3" preload="auto" autoplay loop></audio> with a space before the </body> and place your audio file into the published output folder and there you go. That is it.
Here is an example, http://bit.ly/1sy5dkV and the output folder is attached.
Have fun!
Hello, Everyone! ✨
I'm happy to share that we have released a new update for Storyline 360 (Build 3.79.30834.0).
In this update, we have an enhancement where:
- Background audio is now supported in the published video output.
As a first step, I recommend updating Storyline 360 to the latest version. Here's how:
If you have any questions, please let us know in this thread or privately in a support case.
Have a great day!
281 Replies
- AprilPriceCommunity Member
Thanks for the heads up on signature.
No problem - not every wants it out in the public view. :)
- DebraBrownCommunity Member
I'm definitely trying this out. Thanks for the tip.
- AnaVictóriaCommunity Member
Thanks for the tip guys!!
- AdrianaBertolanPartner
Great example! Love it
- WendyFarmerSuper Hero
Wow - thanks for sharing Emily - this is great.
One question...we create modules with content and then at the end add in a fun Module Challenge which is only maybe 10 slides and the client only wants the music on the challenge.
Do you know a way of just having the audio loop on those specific slides?
- DaveCoxCommunity Member
Hi Wendy,
Add this script to the head section of the story.html file:
<script>
function SetVolume(val)
{
var player = document.getElementById('myAudio');
console.log('Before: ' + player.volume);
player.volume = val / 100;
console.log('After: ' + player.volume);
}
function PauseAudio() {
var player = document.getElementById('myAudio');
player['pause']();
}
function PlayAudio() {
var player = document.getElementById('myAudio');
player['play']();
}
</script>Remove autoplay from the audio tag, so that it looks like this:
<audio id="myAudio" src="bensound-jazzyfrenchy.mp3" preload="auto" loop></audio>
This will cause the audio file to load, but not start. Now all you have to do is call PlayAudio(); from a javascript trigger in your storyline file. You can also call PauseAudio(); to stop the audio.
I Modified emily's file to add a volume control and play and pause buttons.
- WendyFarmerSuper Hero
Wow thanks Dave I'll give it a go and let you know how I go ;-)
- BrennaJueCommunity Member
Wendy, I'm looking for the same feature. Did you ever find out how to do this?
- TeriSlaterCommunity Member
Thanks SO much Emily! Worked like a charm!
- TiaraCCTiaraGutCommunity Member
Hello, I need to know if possible, enter the code in the file " INDEX_LMS "?
Hi Tiara,
Emily is out this week - so I can't speak to the specifics of her set up - are you looking to add it there for use within your LMS? It's worth giving it a try if the story.html file isn't working for you - and you could always upload it to SCORM Cloud if you're not ready to post within your LMS.
- TiaraCCTiaraGutCommunity Member
Hi Ashley
But where in the code " INDEX.LMS " could go audio code ?
Related Content
- 2 months ago
- 3 months ago
- 7 months ago
- 4 months ago
- 6 months ago