Dart Documentationchrome.ttsTtsSpeakParams

TtsSpeakParams class

class TtsSpeakParams extends ChromeObject {
 TtsSpeakParams({bool enqueue, String voiceName, String extensionId, String lang, String gender, var rate, var pitch, var volume, List<String> requiredEventTypes, List<String> desiredEventTypes, var onEvent}) {
   if (enqueue != null) this.enqueue = enqueue;
   if (voiceName != null) this.voiceName = voiceName;
   if (extensionId != null) this.extensionId = extensionId;
   if (lang != null) this.lang = lang;
   if (gender != null) this.gender = gender;
   if (rate != null) this.rate = rate;
   if (pitch != null) this.pitch = pitch;
   if (volume != null) this.volume = volume;
   if (requiredEventTypes != null) this.requiredEventTypes = requiredEventTypes;
   if (desiredEventTypes != null) this.desiredEventTypes = desiredEventTypes;
   if (onEvent != null) this.onEvent = onEvent;
 }
 TtsSpeakParams.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

 /**
  * If true, enqueues this utterance if TTS is already in progress. If false
  * (the default), interrupts any current speech and flushes the speech queue
  * before speaking this new utterance.
  */
 bool get enqueue => jsProxy['enqueue'];
 set enqueue(bool value) => jsProxy['enqueue'] = value;

 /**
  * The name of the voice to use for synthesis. If empty, uses any available
  * voice.
  */
 String get voiceName => jsProxy['voiceName'];
 set voiceName(String value) => jsProxy['voiceName'] = value;

 /**
  * The extension ID of the speech engine to use, if known.
  */
 String get extensionId => jsProxy['extensionId'];
 set extensionId(String value) => jsProxy['extensionId'] = value;

 /**
  * The language to be used for synthesis, in the form _language_-_region_.
  * Examples: 'en', 'en-US', 'en-GB', 'zh-CN'.
  */
 String get lang => jsProxy['lang'];
 set lang(String value) => jsProxy['lang'] = value;

 /**
  * Gender of voice for synthesized speech.
  * enum of `male`, `female`
  */
 String get gender => jsProxy['gender'];
 set gender(String value) => jsProxy['gender'] = value;

 /**
  * Speaking rate relative to the default rate for this voice. 1.0 is the
  * default rate, normally around 180 to 220 words per minute. 2.0 is twice as
  * fast, and 0.5 is half as fast. Values below 0.1 or above 10.0 are strictly
  * disallowed, but many voices will constrain the minimum and maximum rates
  * further-for example a particular voice may not actually speak faster than 3
  * times normal even if you specify a value larger than 3.0.
  */
 dynamic get rate => jsProxy['rate'];
 set rate(var value) => jsProxy['rate'] = jsify(value);

 /**
  * Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being
  * highest. 1.0 corresponds to a voice's default pitch.
  */
 dynamic get pitch => jsProxy['pitch'];
 set pitch(var value) => jsProxy['pitch'] = jsify(value);

 /**
  * Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being
  * highest, with a default of 1.0.
  */
 dynamic get volume => jsProxy['volume'];
 set volume(var value) => jsProxy['volume'] = jsify(value);

 /**
  * The TTS event types the voice must support.
  */
 List<String> get requiredEventTypes => listify(jsProxy['requiredEventTypes']);
 set requiredEventTypes(List<String> value) => jsProxy['requiredEventTypes'] = jsify(value);

 /**
  * The TTS event types that you are interested in listening to. If missing,
  * all event types may be sent.
  */
 List<String> get desiredEventTypes => listify(jsProxy['desiredEventTypes']);
 set desiredEventTypes(List<String> value) => jsProxy['desiredEventTypes'] = jsify(value);

 /**
  * This function is called with events that occur in the process of speaking
  * the utterance.
  */
 dynamic get onEvent => jsProxy['onEvent'];
 set onEvent(var value) => jsProxy['onEvent'] = jsify(value);
}

Extends

ChromeObject > TtsSpeakParams

Constructors

new TtsSpeakParams({bool enqueue, String voiceName, String extensionId, String lang, String gender, rate, pitch, volume, List<String> requiredEventTypes, List<String> desiredEventTypes, onEvent}) #

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

docs inherited from ChromeObject
TtsSpeakParams({bool enqueue, String voiceName, String extensionId, String lang, String gender, var rate, var pitch, var volume, List<String> requiredEventTypes, List<String> desiredEventTypes, var onEvent}) {
 if (enqueue != null) this.enqueue = enqueue;
 if (voiceName != null) this.voiceName = voiceName;
 if (extensionId != null) this.extensionId = extensionId;
 if (lang != null) this.lang = lang;
 if (gender != null) this.gender = gender;
 if (rate != null) this.rate = rate;
 if (pitch != null) this.pitch = pitch;
 if (volume != null) this.volume = volume;
 if (requiredEventTypes != null) this.requiredEventTypes = requiredEventTypes;
 if (desiredEventTypes != null) this.desiredEventTypes = desiredEventTypes;
 if (onEvent != null) this.onEvent = onEvent;
}

new TtsSpeakParams.fromProxy(JsObject jsProxy) #

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

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

Properties

List<String> desiredEventTypes #

The TTS event types that you are interested in listening to. If missing, all event types may be sent.

List<String> get desiredEventTypes => listify(jsProxy['desiredEventTypes']);
set desiredEventTypes(List<String> value) => jsProxy['desiredEventTypes'] = jsify(value);

bool enqueue #

If true, enqueues this utterance if TTS is already in progress. If false (the default), interrupts any current speech and flushes the speech queue before speaking this new utterance.

bool get enqueue => jsProxy['enqueue'];
set enqueue(bool value) => jsProxy['enqueue'] = value;

String extensionId #

The extension ID of the speech engine to use, if known.

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

String gender #

Gender of voice for synthesized speech. enum of male, female

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

final jsProxy #

inherited from ChromeObject
final dynamic jsProxy

String lang #

The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'.

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

var onEvent #

This function is called with events that occur in the process of speaking the utterance.

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

var pitch #

Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to a voice's default pitch.

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

var rate #

Speaking rate relative to the default rate for this voice. 1.0 is the default rate, normally around 180 to 220 words per minute. 2.0 is twice as fast, and 0.5 is half as fast. Values below 0.1 or above 10.0 are strictly disallowed, but many voices will constrain the minimum and maximum rates further-for example a particular voice may not actually speak faster than 3 times normal even if you specify a value larger than 3.0.

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

List<String> requiredEventTypes #

The TTS event types the voice must support.

List<String> get requiredEventTypes => listify(jsProxy['requiredEventTypes']);
set requiredEventTypes(List<String> value) => jsProxy['requiredEventTypes'] = jsify(value);

String voiceName #

The name of the voice to use for synthesis. If empty, uses any available voice.

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

var volume #

Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0.

dynamic get volume => jsProxy['volume'];
set volume(var value) => jsProxy['volume'] = jsify(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();