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!
- SCOTTSARECommunity Member
Create a Slide Trigger and Execute JS in the slide you want to activate the audio in Storyline. In the slide trigger you can set when the audio file will start, i.e. by user interaction, timeline, cue, etc. The audio will play from that moment fwd regardless the number or types of slides placed afterwards. There may / not be a way to adjust looping or volume control, but I have not looked into it yet. I just tested this and it worked much in the same way as the html audio scr trick mentioned above except you can set when its to begin. You must Publish the module to test this feature - it does not work in Preview.
Add Script:
var audio = new Audio('audio_file.mp3');
audio.play();Add *.mp3 File:
Place the audio file in the same location as the story.html file.Pros: You can control when and how the audio will begin playing in Storyline.
Cons: As is, the volume control switch in Storyline will not control the volume of the audio file (Shazbat!) so it will either need to be adjusted using an unrelated program prior to publish or with additional script - if it exists.
Enjoy and good luck. Ja.
- rosycolelliCommunity Member
Hi Milene.
The audio isn't playing on iPad or iPhone due to iOS restrictions that prevent audio from autoplaying in mobile Safari.
Unfortunately. I've tried different ways. But it's all the same.
- MileneBelowCommunity Member
Basically, I am publishing the content to my local drive, adding in the music script, etc. I then place the published folder in our public network drive (S:drive) for our IT folks to upload to our Intranet web server. When clicking the story.html file from the S:drive, it doesn't play the music. For kicks and grins, I placed the music code in the sotry_html5.html folder and when I click on that, it plays. We tried linking to that file on the web server but all it does is play the music and we get a blank display.
Hi Rovie,
Due to some changes in the published output based on Storyline 3 and 360's shift to allow for HTML5 first/only publishing it changed the way this workaround behaved. I haven't seen an example that someone's created for the latest versions of Storyline - but we'll keep you posted if we see it and link back to this discussion.
- ToddHaynes-f106Community Member
I tried the JS solution, but found it too cumbersome and worried about support for SCORM and our LMS. So, my solutions so far are to 1) use Storyline 360 and build everything in 1 slide with an imported audio file and then develop all the content in a TON of layers, or 2) use different product like Captivate or Camtasia.
- OwenHoltSuper Hero
I've used the JS solution on Sl1, SL2, and SL3 without any issue when publishing to web or using scorm on our lms. I don't find it to be cumbersome at all.
What would be cumbersome to me would be building an entire course on one slide!
- FredGoodCommunity Member
Hello Anna,
I use SL3 and I got this to work, but I had to struggle a bit to learn how to do it. Here's what I did:Note that when I would publish it created a folder that contained many files, two of which we will focus on:
story.html
and
story_html5.html
---
1. In your story.html file, open it with notepad (or your favorite html editor) BEFORE (NOT BETWEEN) the </body> and </html> tags, place this code snippet:<audio src="NAMEOFYOURAUDIOFILE.mp3" preload="auto" autoplay loop></audio>
---
2. In your story_html5.html file, open it with notepad (or your favorite html editor) BETWEEN (NOT BEFORE) the </body> and </html> tags, place this code snippet:<audio src="NAMEOFYOURAUDIOFILE.mp3" preload="auto" autoplay loop></audio>
***I made sure to put a space and a hard return after the code snippet, as was instructed in the original post, and that appeared to help.
---
3. Make sure to put the mp3 file in the folder at root level (meaning in the same folder as the story_html5.html file). Make sure the file name of the mp3 matches the name in the code precisely!I hope this helps! I haven't had a chance to see how it works after loading onto our particular LMS, but so far it works in previewing and the output files are working for me! :) Good luck!
- JillSpealman-97Community Member
I can hardly believe it, but I did get this to work today in Chrome and IE on Cornerstone On demand LMS on a Windows 10 laptop. Today I have Version 72.0.3626.96 (Official Build) (64-bit). However yesterday I had Version 71 something. Who knows. Here are the details:
1. I'm running Storyline 360 October 30, 2018 version (due to two other bugs that I hope get fixed sometime).
2. Published using SCORM 2004 3rd edition, HTML 5/Flash. (Note: publishing with HTML5 did not work for me)
3. I opened the folder for the course in Documents>My Articulate Projects (or wherever you publish to).
4. I added my sound file (yourmusicfilename.mp3) to the root of my published course.
4. Code:<audio src="yourmusicfilename.mp3" preload="auto" autoplay loop></audio>
I added this line of code BEFORE <body> and <html> in these 2 files: index_lms.html and story.html. I used Notepad to do this. Be sure to save.5. I added the same line of code above BETWEEN <body> and <html> in these 4 files: index_lms_flash.html, index_lms_html5.html, story_flash.html, and story_html5.html.
6. I zipped it all back up and sent to my client's Cornerstone administrator to load (this was about the 6th try).
7. Tested the course in Chrome and my music is playing through the entire course. It's also working in IE.
Before hitting Post here, I just went back to make sure I wasn't hallucinating and it still works. Somehow it is possible to make this work, in Cornerstone anyway. Good luck!
- NishadKulkarniCommunity Member
Hi Jill,
Glad that it worked. Did you try it on ios device? iPhone or iPad? did it work on those?
Thanks
- DeirdreShermanCommunity Member
Jill,
Can you explain what "BEFORE <body> and <html>" means? The original post indicated the line of code be added after you "...scroll to the bottom and add this code with a space before the </body>" - I see one "body" reference at the bottom of my file. I take it we mean pasting the code before the reference "body" with a space between </body> and the end of the code.
Is this correct?
- ToddHaynes-f106Community Member
I don't use this code because I find it to be technically buggy and the process is time consuming (hand edit code each time you publish). Instead, I've build projects with only 1 slide and a LOT of layers. Just put the background audio in your slide or a layer... The viewer has no idea the presentation is composed this way. Yes, managing that many layers has it's own issues - but when you click Publish, it works on ALL browsers and mobile devices and has no issues with LMS & SCORM integration.
- DeirdreShermanCommunity Member
Hi,
I wonder how you would make this work for a traditional course with multiple lessons, quizzes, results slides, etc. How do you use only one slide with quizzes at the end of each lesson?
- MlaniePellet784Community Member
does it work with Storyline 360?
- JillSpealman-97Community Member
I have to agree with Gerry. Almost 4 years and 220 replies, not to mention countless hours trying to get it to work. As IDs, we are competing for the attention of people who walk around with a pocket-sized world of entertainment at their fingertips. If we can become more interesting by playing a tune through an entire (and it's gotta be short) item of training, I'll take the chance. Please Articulate, add this feature already.