Dart Documentationchrome.ttsTtsEvent

TtsEvent class

An event from the TTS engine to communicate the status of an utterance.

class TtsEvent extends ChromeObject {
 TtsEvent({String type, var charIndex, String errorMessage}) {
   if (type != null) this.type = type;
   if (charIndex != null) this.charIndex = charIndex;
   if (errorMessage != null) this.errorMessage = errorMessage;
 }
 TtsEvent.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

 /**
  * The type can be 'start' as soon as speech has started, 'word' when a word
  * boundary is reached, 'sentence' when a sentence boundary is reached,
  * 'marker' when an SSML mark element is reached, 'end' when the end of the
  * utterance is reached, 'interrupted' when the utterance is stopped or
  * interrupted before reaching the end, 'cancelled' when it's removed from the
  * queue before ever being synthesized, or 'error' when any other error
  * occurs. When pausing speech, a 'pause' event is fired if a particular
  * utterance is paused in the middle, and 'resume' if an utterance resumes
  * speech. Note that pause and resume events may not fire if speech is paused
  * in-between utterances.
  * enum of `start`, `end`, `word`, `sentence`, `marker`, `interrupted`,
  * `cancelled`, `error`, `pause`, `resume`
  */
 String get type => jsProxy['type'];
 set type(String value) => jsProxy['type'] = value;

 /**
  * The index of the current character in the utterance.
  */
 dynamic get charIndex => jsProxy['charIndex'];
 set charIndex(var value) => jsProxy['charIndex'] = jsify(value);

 /**
  * The error description, if the event type is 'error'.
  */
 String get errorMessage => jsProxy['errorMessage'];
 set errorMessage(String value) => jsProxy['errorMessage'] = value;
}

Extends

ChromeObject > TtsEvent

Constructors

new TtsEvent({String type, charIndex, String errorMessage}) #

Create a new instance of a ChromeObject, which creates and delegates to a JsObject proxy.

docs inherited from ChromeObject
TtsEvent({String type, var charIndex, String errorMessage}) {
 if (type != null) this.type = type;
 if (charIndex != null) this.charIndex = charIndex;
 if (errorMessage != null) this.errorMessage = errorMessage;
}

new TtsEvent.fromProxy(JsObject jsProxy) #

Create a new instance of a ChromeObject, which delegates to the given JsObject proxy.

docs inherited from ChromeObject
TtsEvent.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

Properties

var charIndex #

The index of the current character in the utterance.

dynamic get charIndex => jsProxy['charIndex'];
set charIndex(var value) => jsProxy['charIndex'] = jsify(value);

String errorMessage #

The error description, if the event type is 'error'.

String get errorMessage => jsProxy['errorMessage'];
set errorMessage(String value) => jsProxy['errorMessage'] = value;

final jsProxy #

inherited from ChromeObject
final dynamic jsProxy

String type #

The type can be 'start' as soon as speech has started, 'word' when a word boundary is reached, 'sentence' when a sentence boundary is reached, 'marker' when an SSML mark element is reached, 'end' when the end of the utterance is reached, 'interrupted' when the utterance is stopped or interrupted before reaching the end, 'cancelled' when it's removed from the queue before ever being synthesized, or 'error' when any other error occurs. When pausing speech, a 'pause' event is fired if a particular utterance is paused in the middle, and 'resume' if an utterance resumes speech. Note that pause and resume events may not fire if speech is paused in-between utterances. enum of start, end, word, sentence, marker, interrupted, cancelled, error, pause, resume

String get type => jsProxy['type'];
set type(String value) => jsProxy['type'] = value;

Methods

JsObject toJs() #

inherited from ChromeObject
JsObject toJs() => jsProxy;

String toString() #

inherited from ChromeObject

Returns a string representation of this object.

docs inherited from Object
String toString() => jsProxy.toString();