Custom eLearning and Digital Training Solutions Provider
  • Home
  • eLearning Services
    • Custom Elearning Solutions
    • Convert PowerPoint to eLearning
    • Rapid eLearning Development
    • Translation and Localization
    • Flash To HTML5 Conversion
    • Legacy Content Conversion
    • Mobile Learning
    • Gamified Learning Solutions
    • Blended Learning Solutions
  • Software Development
    • Learning Management System
    • Workforce Management System
    • Human Resource Management System
    • Bug Tracker Software
    • Custom Software Development
  • Contact Us
  • Blog
  • Search
  • Menu Menu
  • 0Shopping Cart
  • Home
  • eLearning Services
    • Custom Elearning Solutions
    • Convert PowerPoint to eLearning
    • Rapid eLearning Development
    • Translation and Localization
    • Flash To HTML5 Conversion
    • Legacy Content Conversion
    • Mobile Learning
    • Gamified Learning Solutions
    • Blended Learning Solutions
  • Software Development
    • Learning Management System
    • Workforce Management System
    • Human Resource Management System
    • Bug Tracker Software
    • Custom Software Development
  • Contact Us
  • Blog

How to Add Smooth Background Music in Storyline 360 Using JavaScript

Adding background music to your eLearning courses can significantly enhance learner engagement. However, abrupt audio transitions can feel unprofessional and distracting.

Click Preview to watch the video tutorial on adding background music in Storyline 360 using JavaScript.

Preview

In this guide, you’ll learn how to add smooth background music in Articulate Storyline 360 using JavaScript, including fade-in and fade-out effects, volume control and seamless playback across slides.

This method is perfect for eLearning designers who want polished, professional audio experiences in their courses.

Why Smooth Background Music Matters in eLearning

Poor audio transitions can disrupt learning. Smooth background music:

1. Enhances learner focus and engagement
2. Creates immersive learning environments
3. Improves course professionalism
4. Supports storytelling and retention

That’s why implementing fade-in and fade-out effects to control volume is a best practice in custom eLearning development.

Looking to enhance your Storyline courses?
Partner with Swift eLearning services for custom eLearning development, Storyline 360 expertise and advanced interactivity solutions.

Learn More

Step-by-Step guide: Add Smooth Background Music Using JavaScript

Step 1: Add Background Audio in Storyline 360

● Open your course in Articulate Storyline 360
●
Go to the Insert tab
● Click Audio → Background Audio
● Select Create Playlist
● Add your audio file and click OK

Preview your course — the audio will play continuously across slides.

Step 2: Create a Volume Control Variable

Create a number variable:
● Name: Bg_Control_Volume
●
Default Value: 100

This variable will control the background music volume dynamically.

Step 3: Configure Slide Master for Global Control

● Go to View → Slide Master
●
Select the main Master Slide

Now add the following triggers:

Trigger 1: Set Initial Volume
● Action: Adjust background audio volume
●
Set to: 0%
● When: Timeline starts

Trigger 2: Sync Volume with Variable
● Action: Adjust background audio volume
●
Set to: Bg_Control_Volume
● When: Variable changes

Trigger 3: Stop Music
● Action: Stop background audio
●
When: Variable changes
● Condition: Bg_Control_Volume = 0

Trigger 4: Play Music
● Action: Play background audio
●
When: Variable changes
● Condition: Bg_Control_Volume = 1

Step 4: Add Fade-In Effect Using JavaScript

Create a new trigger:
●
Action: Execute JavaScript

var player = GetPlayer();
var duration = 1000; // 5 seconds
var interval = 10;   // update every 50ms
var steps = duration / interval;

var targetVolume = 100; // increase up to 50%
var currentVolume = player.GetVar(“Bg_Control_Volume”);

// If starting from 0, ensure it’s initialized
if (currentVolume < 0) currentVolume = 0;

var increment = (targetVolume – currentVolume) / steps;

var fade = setInterval(function() {
currentVolume += increment;

if (currentVolume >= targetVolume) {
currentVolume = targetVolume;
clearInterval(fade);
}

player.SetVar(“Bg_Control_Volume”, Math.round(currentVolume));
}, interval);

● When: Timeline starts

Add a fade-in script to gradually increase the volume over one second (or adjust the duration based on your course requirements), then click OK.

This ensures your background music starts smoothly instead of abruptly.

Step 5: Add Fade-Out Effect Using JavaScript

Next, create another trigger:

● Action: Execute JavaScript

var player = GetPlayer();

// Clear any existing fade (IMPORTANT)
if (window.bgFadeInterval) {
clearInterval(window.bgFadeInterval);
}

// Settings
var duration = 5000; // 5 seconds
var interval = 50;
var steps = duration / interval;

var currentVolume = player.GetVar(“Bg_Control_Volume”);
var targetVolume = 0;

// Smaller step = smoother fade
var decrement = (currentVolume – targetVolume) / steps;

// Store interval globally so we can clear it later
window.bgFadeInterval = setInterval(function() {

currentVolume -= decrement;

if (currentVolume <= targetVolume) {
currentVolume = targetVolume;
clearInterval(window.bgFadeInterval);
}

player.SetVar(“Bg_Control_Volume”, Math.round(currentVolume));

}, interval);

● When: Timeline reaches 5 seconds before the end

Add a fade-out script to gradually decrease the volume over five seconds, then click OK.

This prevents sudden audio cuts during slide transitions.

Step 6: Apply Across Slide Master

To maintain consistency:
● Repeat the same steps on other slides within the Slide Master
● Adjust the trigger timing as needed (e.g., 20 seconds before the end)
● Apply a fade-out script that matches the selected duration

This ensures consistent audio behavior across your entire course.

Step 7: Preview and Test

● Preview your course
● Confirm that the background music:

    • Fades in smoothly at the start
    • Fades out naturally before the slide ends

Want more advanced Storyline tips and techniques?

Explore free Storyline 360 tutorials, including JavaScript hacks and eLearning solutions designed to elevate your course design.

Explore Free Tutorials

When Should You Use This Technique?

This method is ideal for:
1. Corporate training courses
2. Compliance training (WHMIS, safety, onboarding)
3. Scenario-based learning
4. Gamified eLearning modules

At Swift eLearning services, we apply this approach to ensure engaging and distraction-free learning environments.

Best Practices for Smooth Audio in Storyline 360

  • Keep background music subtle (20–40% volume recommended)
  • Avoid looping short tracks excessively
  • Use fade-in/out on every slide transition
  • Test across devices (desktop, mobile, LMS)
  • Ensure audio doesn’t interfere with narration

Summary

Smooth background music can transform your eLearning course from basic to professional. With the power of JavaScript in Storyline 360, you can create seamless audio transitions that enhance learner engagement and retention.

Explore eLearning Samples

See how our custom-designed courses deliver engaging, results-driven learning experiences.

View Our Work

Frequently Asked Questions (FAQs)

How do I add background music in Storyline 360?

To add background music, go to Insert → Audio → Background Audio, select Create Playlist, upload your audio file and click OK. The music will play continuously across slides.

Can I create fade-in and fade-out effects to control volume in Storyline 360?

Yes. While Storyline 360 does not support this natively, you can use JavaScript triggers to gradually increase or decrease the volume for smooth fade effects.

Does Storyline 360 support JavaScript?

Yes, Storyline 360 supports JavaScript triggers, allowing developers to implement advanced functionality like audio control, animations and custom interactions.

How do I sync background music with slide timing?

You can sync music by adjusting slide duration, using timeline triggers and applying fade-in/out effects so the audio aligns naturally with slide transitions.

What is the advantage of using JavaScript in Storyline 360 audio control?

JavaScript provides advanced control over audio behavior, including smooth transitions, dynamic volume adjustment and improved user experience.

Ready to transform your training with AI-optimized eLearning?

Partner with Swift eLearning services for custom development, advanced interactivity and next-gen digital training solutions.

Contact us

ARTICULATE STORYLINE POSTS

  • step-by-step guide to customize quiz feedback colors in rise 360
    How to Customize Correct and Incorrect Answers Feedback Colors in Articulate Rise 360June 27, 2025 - 4:40 PM
  • removing labels and numbers from process blocks in articulate rise 360
    How to Remove Labels and Numbers from Process Blocks in Articulate Rise 360June 20, 2025 - 3:07 PM
  • easy-online-course-creation-ispring-suite-swift-elearning-services
    Create Online Courses with Ease Using iSpring Suite – The All-in-One eLearning Authoring Tool for PowerPointJune 16, 2025 - 11:18 AM
  • how to adjust padding in articulate rise 360 content blocks for custom e-learning
    How to Adjust Padding in Articulate Rise 360 Content Blocks for Custom E-LearningJune 9, 2025 - 5:23 PM
  • swift elearning services focuses on crafting custom elearning courses that enhance digital learning experiences.
    How to Use Snapshots to Recover Deleted Lessons in Articulate Rise 360April 23, 2025 - 3:58 PM
  • swift elearning services provides articulate 360 localization, offering tailored elearning solutions that adapt your content for global audiences.
    Articulate 360 Localization: Create, Translate, and Manage Training with EaseApril 17, 2025 - 11:24 AM
  • custom elearning solution with jump-to-time video control in storyline 360 for interactive video navigation.
    How to Use Jump-to-Time Trigger to Control Video in Storyline 360April 11, 2025 - 10:51 AM
  • how to import slides from other storyline projects
    Articulate Storyline 360 – How to Import Slides from Other Storyline ProjectsMarch 25, 2025 - 5:52 PM
  • ohs-traffic-control-training-for-construction-workers-featured-image
    OHS – Traffic Control Training Course for Construction WorkersSeptember 9, 2024 - 5:56 PM
  • ohs-road-traffic-control-training-for-road-maintenance-workers-featured-image
    OHS – Traffic Control Work Zone Safety Training for Road Maintenance WorkersAugust 1, 2024 - 3:22 PM

Get a Free Prototype Customized with Your Content.

Our Portfolios Explore Our Extensive Collection of eLearning Courses.

GET A FREE ELEARNING SAMPLE

We transform your training material into engaging, SCORM-compliant courses.

Request a Free Sample  

Our Services


  • Rapid eLearning Solutions

  • Custom eLearning Development

  • Flash to HTML5 Conversion Services

  • Mobile Learning Solutions

  • Translation and Localisation Services

  • Gamification eLearning

Our Office Address

Asia: 704, Topaz Plaza, Punjagutta, Hyderabad, Telangana, India 500082

Australia: P.O. Box 107, Brisbane, Queensland, 4030

Canada: 750 Oakdale Rd Suite 56, North York, ON M3N 2Z4, Canada

USA: 12218 Old Gage Ranch, San Antonio, Texas 78245

Copyright ©2026 Swift eLearning Services.
  • Facebook
  • Twitter
  • LinkedIn
  • Youtube
How to improve eLearning Readability Using a Blurred Backgrounds EffectCustom eLearning Leave-Behind Using Storyline 360
Scroll to top