Self Voicing

Overview

Component Name: gpii.firstDiscovery.selfVoicing

File: selfVoicing.js

Provides a Text-to-Speech engine for vocalizing text.

Note: This is will only work in browsers that support the SpeechSynthesis API.

Using the Self Voicing component

Option 1: Typically this component is used as a sub-component of the Preferences Editor Loader, particularly the First Discovery Tool Editor:

selfVoicing: {
    type: "gpii.firstDiscovery.selfVoicing",
    options: {}
}

Option 2: Outside the context of the First Discovery Tool, developers may wish to create a standalone component:

var mySelfVoicing = gpii.firstDiscovery.selfVoicing(options);

Grades

This component uses the following base grades:

Methods

MethodDescriptionParameters
queueSpeech Calls queueSpeechImpl if the enabled model value is true or the force option value is true.
text (string)
The string of text to be voiced
options (Object)
Any valid speech utterance options (see: utteranceOpts)
force (string)
If true, force to turn on the self voicing
queueSpeechImpl Makes use of the fluid.textToSpeech.queueSpeech to queue speeches.
text (string)
The string of text to be voiced
interrupt (boolean)
Whether or not to stop the self voicing
options (Object)
Any valid speech utterance options (see: utteranceOpts)
clearQueue Empties the queue if the self voicing is disabled (muted). none

Dependencies

<script type="text/javascript" src="src/lib/infusion/infusion-custom.js"></script>
<script type="text/javascript" src="src/js/selfVoicing.js"></script>