Skip to main content
Evan Berrett
Inspiring
February 14, 2014
Answered

Need help with Conditional Audio

  • February 14, 2014
  • 1 reply
  • 682 views

Hello again! So early on into a course, after a couple intro slides, I have a sorting slide to direct users to other parts of a course (self-led learning in a way). However, I have an audio narration that plays on entry to that slide (not slide audio, it plays via advanced actions). I'm trying to figure out a way so that once they have viewed that slide once and heard that audio the first time, any time they get sent back to this sorting slide, they don't hear the audio again. How might this be done?

What I have already tried: I've tried two things, first I set up a variable called Sort_Audio. On exit of the slide previous, Sort_Audio would be assigned a value of 10. On entry to the sorting slide, an advanced action would check if Sort_Audio is equal to 10. If it is, it plays audio (and clears another variable that is unrelated, I just needed to do both things, so I combined them). I have On Exit from the sorting slide an advanced action that resets Sort_Audio to 0 so that when a user gets sent back to that sorting slide, it would theoretically not star the audio. Problem with this in the first place is for some reason it won't even play the audio the first time.

The other thing I tried was quite similar, but instead of assigning values to slides I tried cpInfoLastSlideViewed and equalled it to the name of the previous slide, as well as doing the same thing for cpInfoPreviousSlide. Neither seemed to work.

Any help would be much appreciated! Thanks!

This topic has been closed for replies.
Correct answer Lilybiri

I have demonstrated this work flow several times (DevLearn 2012, recently on an online forum of the eLearning Guild).

Don't use the On Exit event at all.  Have a user variable with an initial value (I used 0). Create a conditional action:

   IF v_visit is equal to 0

        Play audio clip

        Assign v_visit with 1

   ELSE

        Continue

Lilybiri

1 reply

Lilybiri
LilybiriCorrect answer
Legend
February 14, 2014

I have demonstrated this work flow several times (DevLearn 2012, recently on an online forum of the eLearning Guild).

Don't use the On Exit event at all.  Have a user variable with an initial value (I used 0). Create a conditional action:

   IF v_visit is equal to 0

        Play audio clip

        Assign v_visit with 1

   ELSE

        Continue

Lilybiri

Inspiring
April 16, 2014

Lieve,

I have tried this several times and it still plays the audio. To test, I have two slides. First one has audio that plays on the slide and a next button. Slide two has a back button to the first slide. The first slide has an "on enter" advanced action which is just as you have provided above. It still plays audio everytime. I also tried to put the audio on an object and took it off the slide. Same problem, audio plays.

I am using Cp7.01.

I apologize for troubling you with this. I have found other responses you have provided and tried one of them that uses an increment (v_counter = v_counter + 1) and I couldn't get it to work that way either.

Thank you.

Michael

RodWard
Community Expert
Community Expert
April 17, 2014

I would recommend that you add your audio to an object such as a text caption or highlight box and set its transparency to 0 so that it is invisible.  Place this object on your slide where you only want the audio to play the first time it is visited.

Use a counter to track how many times the user has visited that slide.  Use On Slide Enter to execute an Advanced Action to HIDE the object if the counter value indicates previous visitation.

It is my belief you are running into issues controlling your audio because you are using Advanced Actions to trigger the audio directly using the Play Audio action.  Once you trigger audio this way you have to use another Advanced Action to turn it off again.  I think using audio attached to slide objects that can be shown or hidden is likely to be less trouble.