TtsOptions constructor
TtsOptions({})
Implementation
TtsOptions({
/// 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? enqueue,
/// The name of the voice to use for synthesis. If empty, uses any available
/// voice.
String? voiceName,
/// The extension ID of the speech engine to use, if known.
String? extensionId,
/// The language to be used for synthesis, in the form _language_-_region_.
/// Examples: 'en', 'en-US', 'en-GB', 'zh-CN'.
String? lang,
/// Gender of voice for synthesized speech.
VoiceGender? gender,
/// 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.
double? rate,
/// Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2
/// being highest. 1.0 corresponds to a voice's default pitch.
double? pitch,
/// Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1
/// being highest, with a default of 1.0.
double? volume,
/// The TTS event types the voice must support.
List<String>? requiredEventTypes,
/// The TTS event types that you are interested in listening to. If missing,
/// all event types may be sent.
List<String>? desiredEventTypes,
/// This function is called with events that occur in the process of
/// speaking the utterance.
JSFunction? onEvent,
}) : _wrapped = $js.TtsOptions(
enqueue: enqueue,
voiceName: voiceName,
extensionId: extensionId,
lang: lang,
gender: gender?.toJS,
rate: rate,
pitch: pitch,
volume: volume,
requiredEventTypes: requiredEventTypes?.toJSArray((e) => e),
desiredEventTypes: desiredEventTypes?.toJSArray((e) => e),
onEvent: onEvent,
);