Documentation

MultiAudio

Description

It's an upgraded version of the Audio addon. New features: multi audio files, loop for each file, the possibility of assigning ID to each file in order to jump between files, improved interface selection.

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, which are described below.

This property allows online resources. Find out more ยป

ID This must be a unique value. It's use for command jumpToID.
Mp3 It's a file with mp3 extension.
Ogg It's a file with ogg extension.
Enable loop True or False property, which enable looping for current file.
Narration Narration for recorded audio
Interface Specifies the way of displaying the MultiAudio addon. If you do not wish the addon 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 other addons, such as Multiple Gap.

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 a audio number out of this range will have no effect
jumpToID audio id Jumps to specified audio ID (provided in Addon configuration, IDs property). Providing a audio ID not defined in IDs property will have no effect
previous - Jumps to previous audio. If the first audio is currently displayed this command will have no effect
next - Jumps to 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()
show --- Shows the module
hide --- Hides the module

Advanced Connector integration

Each command supported by the MultiAudio Addon can be used in the Advanced Connector addon scripts. The below examples show how to play next audio when True/False addon will send correct event and how to jump to audio with ID = 1 when 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 addon sends ValueChanged type events to Event Bus when playing begins.

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

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

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

When 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), MultiAudio addon sends pause event to Event Bus.

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

When MultiAudio playback is finished, MultiAudio addon sends OnEnd event to 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 contain examples of how to use MultiAudio addon.