Loading...
 

Speech

Speech (WebWidget)

The Speech WebWidget offers the possibility of speech input and output.

Use

Web(speech, "speech.html", 0, 0, 800, 600)

Dependencies

  • speech.html
  • speech-directive.js

message-interface

In the directional description, the WebWidget is divided into its two components. The WebWidget implemented in HTML, which implements the display logic and user interaction in the browser, and the WebWidget implemented in InstantView, which provides the other side with the data from ClassiX and controls it.

NameParametersDescription
Push messages (IV→HTML)
speakUtteranceThis message passes an Utterance object as a CX_JSON_OBJECT to the WebWidget and specifies the text to be spoken.
listenParametersThis message passes parameters as CX_JSON_OBJECT to the WebWidget and starts speech input.
stop_listening-This message instructs the WebWidget to stop speech input.
Events (HTML→IV)
TRANSCRIPT_SOCKETResultThis message is triggered when the speech input has a result. This can be an intermediate result.

The Utterance object

FieldTypeDefaultDescription
textString-

This is the text to be spoken. As the only value, not optional.

pitchFloat1.0Must be in the range 0.0 - 2.0. Changes the pitch of the voice. Optional.

volumeFloat1.0

Must be in the range 0.0 - 1.0. Changes the volume of the voice. Optional.

rateFloat1.0

Must be in the range 0.1 - 10.0. Changes the speed of the voice. Optional.

longFloat"en"A string specifying the language (in BCP47 format, e.g. "en-GB"). Optional.

The parameter object

FieldTypeDefaultDescription
continuousBooleanFALSE

Determines whether the speech input should be terminated after an input.

If TRUE, then listening continues until stop_listening is sent.

interimResultsBooleanFALSE

Determines whether intermediate results are to be sent.

If FALSE, only a result is sent when the user stops speaking.

If TRUE, fragmentary results are also sent beforehand.

maxAlternative Integer1

How many alternatives are to be sent. The result is a list of alternatives sorted by descending probability.

Example: "A whale", "Dial-in", "A choice", "A whale", etc.

The Result object

FieldTypeDescription
isFinalBoolean

TRUE if the user has stopped speaking, FALSE if they have not finished.

If interimResult is FALSE, isFinal will always be TRUE.

lengthIntegerThe number of alternatives, at most maxAlternatives.
0 ... length-1AlternativeThe Result object is an array of alternatives, sorted by descending probability.

The Alternative object

FieldTypeDescription
confidenceFloat

The probability that the user actually said this text. 0.0 - 1.0

transcriptStringThe text that the user said.