Skip to main content

Utterance

Module: Inworld.AI. Namespace: Inworld.Interactions. Inherited from IContainable

This data structure is used to host the utterances. Utterances contains several InworldPackets that should be aligned at the same expression. For example, its AudioPacket and its TextPackets are usually aligned as the same sentence.

Variables

VariablesDescription
PacketsThe dictionary to host its contained InworldPackets.
The key is the InworldPackets's PacketID.
The value is the InworldPackets itself.

Properties

PropertiesDescription
IDThe UtteranceID.
RecentTimeThe recent modifying time of the utterance.
PacketsThe list of the InworldPackets. It's the values of the Packets in the Variables.
IsEmptyCheck if the outgoing packet is empty.

API

FunctionDescriptionParameters
ContainsCheck if the InworldPacket is in this utterance.InworldPacket: target packet.
IsPlayableCheck if the utterance is playable (all the data has been received).
AddAdd an InworldPacket into this utterance.InworldPacket: target packet to add.
GetTextSpeedGet the speed of the displaying text. Depending on the length of the text or narrative action.
GetAudioClipGenerate the AudioClip from this utterance if it contains any AudioPackets.
CancelClear all the InworldPackets in this utterance.isHardCancelling: not used.
OnDequeueAlways return true in this class.