Description

Creates an audio object that can be referred to as a target object for any action related to audio playback. It can be displayed on the page with HTML5 controls if Playback Controls property is enabled, otherwise it will be invisible to the end user but still playable through actions.

Properties

Audio object supports most of the Generic Object Properties, plus the ones listed below. To edit properties of an audio object, select it and use the selection inspector at the right of your project window.

Sound The audio asset to be played
Playback Controls Enable to display the HTML5 audio player controls or disable to make the audio invisible to the end user (but still playable through actions). Please note that the playback controls displayed will vary basing on the browser / reader displaying the publication
Loop If enabled, the playback will be repeated once played for the first time

Events

Audio object triggers only some of the Generic Events, namely Accelerometer, Load, Shake and Show. To edit event handlers for an audio object, select it and use the Interactivity Panel on the right side of the project window.

Actions

Audio object can be used as target of most Generic Actions, plus some specific action to control playback:

Play Audio

Plays an audio object. If playback was previously stopped, it will restart where it left off, unless Play From Beginning property is enabled.

Properties
Target Audio object to play
Play From Beginning If enabled, the audio object will be always played from the beginning, even if playback was previously stopped
Wait for Completion If enabled, PubCoder will wait for the audio to complete playback before executing the next action in the same action list, otherwise it will execute the next action immediately Tip: Pausing the audio externally, e.g. by using a Stop Audio action or playback controls, will mark the action as completed anyway

Play/Pause Audio

Plays a paused audio object, resuming from where the playback was stopped, or pauses playback if that object is already playing.

Properties
Target Audio object to play/pause

Seek Audio

Moves the playback time to a certain time. Especially useful for long audio, for example you can make various Buttons to seek to the various chapters in an audio track.

Properties
Target Audio object to seek
Time Define the position, in seconds, to seek the audio to

Set Audio Volume

Changes the playback volume of an audio object

Properties
Target Audio object to set volume to
Volume Decimal number from 0 (mute) to 1 (maximum volume) indicating the audio volume relative to the global device volume

Stop Audio

Stops playback of a playing audio object

Properties
Target Audio object to be stopped