Creating Custom Mute/Unmute Audio Button using Advanced Actions and Variables

Scenario: Many times having a custom button to mute or unmute the sound being played helps a lot. In this post we will discuss how to do that step-by-step. BTW, there is mute/unmute audio button is available in the Playbar as well. This one is to have just this button when we don’t want to have the complete Playbar. See the following demonstration to know what I’m referring to.

Let’s see how to do achieve this…

Step 1: First step is to decide on a cool graphic icon for the mute sound and unmute sound action. I used Adobe Photoshop to create 2 icons and imported them into Captivate. I’ve also inserted a Click box. The logic here is, the Advanced Action which does the mute/unmute the sound is associated to the Click Box. Then why do we need the two icons? That’s the interesting part here… based on the action we will show/hide these icons. I’ve also added a background Audio which will be controlled by the button we are going to create. Following demonstration talks about the initial setup.

Step 2: Now we will create the advanced action to mute or unmute the sound. We will create a variable ‘soundPlaying’ and associate 0 or 1 to that. With the help of a conditional action we will decide whether to mute the sound or unmute it. There is a system variable called ‘cpCmdMute’ which is used for muting or unmuting the sound. Assigning cpCmdMute to 1 mutes the sound and 0 would unmute it. Following demonstration details out these steps.

Step 3: Now that we have successfully created the Advanced Action, let’s associate this to the Click Box we have placed above the icons. Also, we will add additional actions to Show/Hide the icons based the state of Audio. If the Audio is playing, the icon would be ‘unmute’ icon. And if the Audio is not playing, it would show the mute icon. Following demonstration outlines the details related to that.

Hope this post is useful for you!

7 Responses

  1. I tried this an it works however I the audio does not play upon slide entry which is what I want. Right now after following this everything is muted until the user clicks the unmute icon. I can not figure out how to reverse this.

  2. Hi there, this works great thanks, I was wondering if it could be amended to have the slide audio paused instead of muted, that way when you clicked to hear again it would play from where you left off?

  3. I seem to be having some problems with this in Captivate 6.
    Two issues specifically.
    1 I cant put a clickbox on any sides that include a question
    2 The show/hide does not work on slides that have interaction widgets on them
    and as my module is being built chiefly out of question slides and interactions this is a problem for me!
    Any ideas?

  4. UH OH – The button works flawlessly the first time I preview it. But I preview it again and it mutes the first time but every time thereafter all I get is a click sound. I tried publishing but I get the same results.

  5. Hi,

    Followed the above instructions. Works fine on the first slide, but on any further slides in the project, the mute and unmute function still works, but the image no longer changes.. any ideas?

Leave a reply