Documentation

MultiAudio

Description

The MultiAudio module enhances the standard Audio module, providing support for multiple audio files.

Properties

The list starts with the common properties. Learn more about them by visiting the Modules description section. The other available properties are described below.

Property name Description
Files It's a list of files. Each file has its properties: ID, MP3, OGG, Enable loop, and Text, which are described below.

This property allows online resources. Find out more ยป

Property name Description
ID This must be a unique value. It's used for the command jumpToID.
MP3 Upload a file with MP3 extension.
OGG Upload a file with OGG extension.
Enable loop Marking the checkbox enables looping for the current file.
Text Displays this text as a draggable item, if the 'Interface: Draggable Items' property is selected.
Narration Narration for the recorded audio.
Interface Specifies the way of displaying the MultiAudio module. If you do not wish the module to be visible at all, set this property to "None". "Display time" will show only the current time and the total length of the currently selected audio file. "Default controls" will display the default audio element for the currently selected audio file. "Draggable items" will display small draggable widgets, one for each item in the 'Files' property, which can be used to fill gaps in the Multiple Gap module.

Supported commands

Command name Params Description
jumpTo audio number Jumps to specified audio number. Audio number should be from 1 to n, where n is the number of configured audio files. Providing an audio number out of this range will have no effect.
jumpToID audio id Jumps to the specified audio ID provided in the module's 'File' property. Using an audio ID not defined in the IDs property will have no effect.
previous - Jumps to the previous audio. If the first audio is currently displayed, this command will have no effect.
next - Jumps to the next audio. If the last audio is currently displayed, this command will have no effect.
play - Plays the audio. Example usage: MultiAudio1.play().
pause - Pauses the audio. Example usage: MultiAudio1.pause().
stop - Stops the audio. Example usage: MultiAudio1.stop().
hide --- Hides the module if it is visible.
show --- Shows the module if it is hidden.

Advanced Connector integration

Each command supported by the MultiAudio module can be used in the Advanced Connector module's scripts. The below example shows how to play the next audio when the True False module will send correct event and how to jump to audio with ID = 1 when the Choice module will send incorrect event.

EVENTSTART
Source:TrueFalse1
Score:1
SCRIPTSTART

var multiAudioModule = presenter.playerController.getModule('MultiAudio1');
multiAudioModule.jumpToID(2);
multiAudioModule.play();

SCRIPTEND
EVENTEND


EVENTSTART
Source:TrueFalse1
Score:0
SCRIPTSTART

var multiAudioModule = presenter.playerController.getModule('MultiAudio1');
multiAudioModule.stop();

SCRIPTEND
EVENTEND

Events

The MultiAudio module sends the ValueChanged type of events to the Event Bus when playing begins.

Field name Description
Item Current item
Value playing
Score N/A

When playback time changes, the MultiAudio module sends a relevant event to the Event Bus.

Field name Description
Item Current item
Value Current time (in MM.SS format)
Score N/A

When the MultiAudio playback stops or is paused, but is not finished (such as after calling pause() or stop() methods, or after a different file has been selected), the MultiAudio module sends the pause event to the Event Bus.

Field name Description
Item Current item
Value pause
Score N/A

When the MultiAudio playback is finished, the MultiAudio module sends the OnEnd event to the Event Bus.

Field name Description
Item Current item
Value end
Score N/A

CSS classes

Class name Description
.wrapper-addon-audio A simple wrapper.

Example

Default styling

.wrapper-addon-audio audio {
    bottom: 0;
    position: absolute;
}

.wrapper-addon-audio {
    height: 30px;
    position: relative;
}

Demo presentation

Demo presentation contains examples of how to use the MultiAudio module.