How to play audio when lightbox closes?

I created a slide that plays an opening narration then opens a lightbox.  After the lighbox content closes, I want the slide to play a closing narration.  I can't figure out how to get the audio to play when the lightbox closes.  I tried using a Boolean variable by changing its value when the lightbox's timeline ends and creating a trigger that plays the audio media when the value of the variable changes but that didn't work.  Can anyone recommend an approach to getting an audio to play when a lightbox closes?

7 Replies
Michael Hinze

One option is to display the lightboxed slide not directly from the baselayer, but via a layer. When the lightbox is closed, the underlaying layer sets a variable and then closes. Back on the baselayer, a sound file is then played based on the variable. See attached a quick example that may give you some ideas.

David Ward

Thank you for sharing your approach and programming sample, Michael.  It made sense to me, so I modified the programming on my slide so that it emulated yours.  All went well with all of the triggers but one.  I encountered a problem when I set this play media trigger:

As soon as I clicked OK in the Trigger Wizard, the audio object became corrupted.  Before setting the trigger, the audio file started at 39 seconds and continued to the end of the timeline.  Every time I try to set the trigger, the audio object stretches out to the beginning of the timeline.  The waveform also simultaneously disappears from the bar that represents it and there is no sound when I play it.  Does anyone know how to prevent this from occurring?

Ashley Terwilliger

Hi David,

It should be ok that the audio now extends on the timeline - as you'd want the audio to start after closing the lightbox and if your slide is to start from the beginning, there would be a 39 second delay until the audio started. I'm concerned though that you feel like the audio object is corrupted, and it won't play at all - I'd first want to check into the following things that are known causes of corruption:

  • Work on your local drive (your C: drive) with all your project files.Working on a network drive or a USB drive can cause erratic behavior, includingfile corruption, loss of audio, and other unexpected behavior. 
  • You should also make sure the directory pathto your project files and your published output is less than 260 characters(for example C:\Articulate).
  • Avoid using special characters, accents orsymbols in your file names.

If you're still having difficulty with it, it may be worth trying to import the existing file into a new Storyline file as described here. 

David Ward

Thanks for responding, Ashley.  Unfortunately, none of the items in your bullet list apply in my project.  So I tried importing the file into a new Storyline project but it didn't resolve the problem either.  The audio still becomes corrupted when I set the trigger in the new project, as well.

The "Closing narration 1" audio plays fine before I set the trigger but, the instant I click the OK button in the Trigger Wizard, the audio becomes corrupted.  I can see it visually because, before I create the trigger, the audio shows a waveform in the gray horizontal bar that represents it:

However, when I create the trigger, Storyline spontaneously stretches the bar out to the beginning of the Timeline and removes the waveform from the bar, replacing it with a speaker icon and some text:

I can also tell it's corrupted because when I play it, there's no sound, either at the beginning of the timeline or beyond 40 seconds into it (where the audio originally began).  Yes, I know these screen captures indicate that the audio is hidden but, when I show the "Closing narration 1" audio, it still plays no sound.

I do not edit the audio in any way when this change occurs.  The only action I take between when the audio works and when it becomes corrupted is creating the trigger.  I've attempted setting the trigger numerous times and it occurs every time.

Ashley Terwilliger

Hi David,

Thanks for the screen captures - from this alone, I'm not sure the audio is "corrupted" but the reason it's extending on the timeline is that it doesn't have a set start time any longer - but it's start time is controlled by the variable. Therefore, it's now available for the entire length of the timeline instead of at the 40 second mark. 

You mentioned it doesn't play - does it not play when you click on the object itself in the timeline to open the audio editor, or does it not play when you preview the slide? If it's the latter, we'll need to look at the triggers as I suspect if you're using the "when variable changes" the variable is changing outside this actual slide - and therefore the trigger will never fire, as it's waiting for the variable to change on that actual slide. If you can't hear the audio when opening the audio editor, that sounds like corruption of the audio file - and since you mentioned it happens with every file, I'd begin by conducting the repair of Storyline. 

David Ward

I tried using the play feature in the Timeline editor and it produced no sound.  I tried double-clicking the audio to check it in the audio editor but the audio editor failed to open (although the other audio on the same slide does open in the audio editor).  So I assumed it was corrupted without trying it in Preview mode.  I checked it in Preview mode just now at your suggestion and the audio played successfully.  I guess it works (although I don't understand why it won't open in the audio editor).  Thanks for your feedback.