speak method

Future<void> speak(
  1. String utterance,
  2. TtsOptions? options
)

Speaks text using a text-to-speech engine. utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters. options The speech options. returns Called right away, before speech finishes. Check runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback.

Implementation

Future<void> speak(
  String utterance,
  TtsOptions? options,
) async {
  await promiseToFuture<void>($js.chrome.tts.speak(
    utterance,
    options?.toJS,
  ));
}