Skip to content

UtteranceWrapper

Overview

A type to wrap an Utterance while in the UtteranceQueue, see UtteranceQueue for implementation. Internal to utterance-queue, should otherwise not need to be used.

@author Jesse Greenberg @author Michael Kauzmann (PhET Interactive Simulations)

Class UtteranceWrapper

One instance per entry in the UtteranceQueue.queue

import { UtteranceWrapper } from 'scenerystack/utterance-queue';

Constructor

new UtteranceWrapper( utterance : Utterance )

Instance Methods

dispose()

Instance Properties

timeInQueue

In ms, how long this utterance has been in the queue. The same Utterance can be in the queue more than once (for utterance looping or while the utterance stabilizes), in this case the time will be since the first time the utterance was added to the queue.

stableTime

is the amount of time since this utterance has been added to the utteranceQueue.

utterancePriorityListener : PriorityListener | null

A reference to a listener on the Utterance priorityProperty while this Utterance is moving through the UtteranceQueue (in the queue and currently being announced). We want to monitor for priority changes to adjust its spot in line when needed.

Source Code

See the source for UtteranceWrapper.ts in the utterance-queue repository.