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!