onSpeak property

EventStream<OnSpeakEvent> get onSpeak

Called when the user makes a call to tts.speak() and one of the voices from this extension's manifest is the first to match the options object.

Implementation

EventStream<OnSpeakEvent> get onSpeak =>
    $js.chrome.ttsEngine.onSpeak.asStream(($c) => (
          String utterance,
          $js.SpeakOptions options,
          JSFunction sendTtsEvent,
        ) {
          return $c(OnSpeakEvent(
            utterance: utterance,
            options: SpeakOptions.fromJS(options),
            sendTtsEvent: sendTtsEvent,
          ));
        }.toJS);