Documentation

TextAudio

The TextAudio addon allows users to play sounds with subtitles in their presentations. This addon works on all common browsers.

Note: It's recommended to use files with bitrate 64 kb/s or higher. The files with lower quality could experience some difficulties in reproduction. It's also important that audio files have constant bitrate because Mozilla Firefox may experience problems while seeking in files that have variable bitrate mode.

Properties

Property name Description
ogg This property serves for uploading an audio file in ogg format into the module. It's needed for all common browsers (exclude Internet Explorer and Safari).

This property allows online resources. Find out more »

mp3 This property serves for uploading an audio file in mp3 format into the module. It's needed for Internet Explorer.

This property allows online resources. Find out more »

defaultControls If this property is checked, the default browser controls will be displayed. In order to make custom controls, just add the event button and call play() or pause() function in the audio addon.
displayTime If this property is checked and defaultControls are unchecked, then the Timer will be shown.
enableLoop If this property is checked, the audio will be played repeatedly.
Slides In this property you define slides with the audio narration. Each slide has property Text – which is the content of the slide and property Times, in which you define durations of each slide.
The content of the slide can be divided into fragments that will be highlighted in different periods of time. The seperator is double pipe "||". The number of pieces of text should be the same as the number of time periods in the Times property.
In the Times property you define time ranges for each piece of text. The time should be in the following format: mm:ss.d, where mm is minute, ss is second and d is the tenth of a second. Time range for each text should be in the seperate line. The tenth of a second parameter is not obligatory.
In the Position and dimensions property you define the position of a slide. This should be in the following format: X;Y;W;H, where X is the position from left, Y is the position from top, W is width and H is height.
For example:
  • Text:
    Lorem ||ipsum ||dolor
  • Times:
    00:00-00:02
    00:02-00:03.5
    00:03.5-00:05
  • Position and dimensions:
    10;10;150;200
onEnd Event to be executed when (and only then) audio ends and loop is not enabled.
Individual fragment playback
deprecated
If this property is checked, only the selected fragment will be played.
Vocabulary audio files playback
deprecated
Defines whether the addon is allowed to use files defined in "Vocabulary audio files" property.
Vocabulary audio files
deprecated
List of files for individual playback.
On Text Click Behavior Defines the action that is expected to happen when a word is clicked by a user. This property replaces the following old properties: "Individual fragment playback" and "Vocabulary audio files playback".
Note: This property is not taken into account when the module has old properties: "Individual fragment playback" or "Vocabulary audio files playback". To use this property, you should remove the old module from the page and add a new one.
Vocabulary ogg This property serves for uploading a vocabulary audio file in ogg format into the module. It's needed for all common browsers (exclude Internet Explorer and Safari). Setting up this property is only needed when On Text Click Behavior is set to "Play the interval from vocabulary file".

This property allows online resources. Find out more »

Vocabulary mp3 This property serves for uploading an audio file in mp3 format into the module. It's needed for Internet Explorer. Setting up this property is only needed when On Text Click Behavior is set to "Play the interval from vocabulary file".

This property allows online resources. Find out more »

Vocabulary intervals In this property you define time intervals for vocabulary audio files. The time periods should be in the same format as in Slides -> Times property. Number of parts in Vocabulary intervals have to be equal to the sum of times periods defined in Slides property. Setting up this property is only needed when On Text Click Behavior is set to "Play the interval from vocabulary file".
Controls In this property, you can choose one of the three options. The "None" option does not display any controls, the "Browser" option displays the default controls for the currently used web-browser. The "Custom" option displays the controls defined by a user in css styles. This option displays the controls independently from a web-browser.
Show Slides In this property, you can choose one of the two options. The "Show current slide" option displays the currently playing slide, the "Show all slides" option displays all added slides.
Is disabled Allows disabling the addon so that it won't be able to interact. Sets the style class for the entire addon to .disabled
Note: It's important to put 2 different file formats if you want your audio to work on all common browsers. If you don't have a file in ogg format, you can use this mp3 to ogg converter. In Safari browser the file size is limited ( ~4mb ).
Note: Due to the policy of Android and iOS systems, using "onEnd" property to play another media element will not work on mobile devices as it requires user interaction.

Supported commands

Command name Params Description
play --- plays the sound if not playing already
pause --- pauses the sound
stop --- stops the sound
show --- shows the module
hide --- hides the module and stops the sound
enable --- enables the addon and removes the .disabled style class for the entire addon
disable --- disables the addons, interrupts the playback and adds the .disabled style class for the entire addon

Advanced Connector integration

Each command supported by the TextAudio addon can be used in the Advanced Connector addon scripts. The below examples show how to play sound when the True/False addon sends an event for the correct answer and how to stop it when the event indicates the incorrect answer.

    EVENTSTART
    Source:TrueFalse1
    Score:1
    SCRIPTSTART
        var audio = presenter.playerController.getModule('TextAudio1');
        audio.play();
    SCRIPTEND
    EVENTEND

    EVENTSTART
    Source:TrueFalse1
    Score:0
    SCRIPTSTART
        var audio = presenter.playerController.getModule('TextAudio1');
        audio.stop();
    SCRIPTEND
    EVENTEND

Events

The TextAudio addon sends ValueChanged type events to Event Bus when playback time changes.

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

When audio playback is finished, TextAudio addon sends OnEnd event to Event Bus.

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

CSS Classes

Class name Description
.wrapper-addon-textaudio An addon's wrapper.
.textaudio-text A wrapper of slide text.
.wrapper-addon-textaudio span Each text fragment is in <span> element.
.wrapper-addon-textaudio span.active The currently highligted <span> element has class .active
.wrapper-addon-textaudio span.textelement[num] Where [num] is the element number counted from 0 on every slide. It is possible that there is more than one element with the same class number but they are always resposible for the same audio part.

Demo presentation

Demo presentation contains examples of how to use the TextAudio addon.