Add the utterance to the queue of utterances to speak.
The implementation must stop any current playing utterance and set itself in paused state. It should then clear the queue of utterances to speak.
Destroys this instance. The synthesizer should clear the utterance queue and set itself in paused state.
The reference to any context
passed with init() is released.
Called before any other method to register the context instance used for various callbacks.
Will be called by the SyncMediaPlayer when it should pause playback.
Resume the playback of the current active utterance if any exists, otherwise the next utterance from the utterance queue. The implementation must use context.onUtteranceEnd() when each utterance has finished speaking.
The implementation should also call context.onBoundary(charOffset) to indicate which part of the utterance is currently being spoken to allow the media player to get a more accurate timeline position for things like automatically turning pages and resuming playback and for highlighting.
Sets if playback should be muted. When called with false, the synthesizer should unmute and use the playback volume last set by setVolume.
Will be called by the SyncMediaPlayer when its playbackRate has been changed.
A value between 0.25 and 5.0
Will be called by the SyncMediaPlayer when its volume has been changed.
A value between 0.0 and 1.0
Generated using TypeDoc
Base interface used for implementing TTS speech synthesizers. A ITtsSynthesizer maintains a queue of ITtsUtteranceData and manages its playback. A newly created ITtsSynthesizer is in paused state, has its volume set to 1.0 and playback rate set to 1.0.
The init() method must be called before you can use the object. The passed context object must be used by the TtsSynthesizer implementation to report its playback state.
The framework provides a default implementation based on the Web Speech API. See WebSpeechTtsSynthesizer for more information.