Module livekit.plugins.keyframe.types

Global variables

var EMOTIONS : tuple[typing.Literal['neutral', 'happy', 'sad', 'angry', 'surprised', 'concerned', 'confused', 'disgusted', 'excited', 'scared', 'skeptical'], ...]

Every emotion the avatar can hold, in the order the model defines them.

var Emotion

An expression the avatar can hold.

var USERDATA_EMOTION_CUES

The key for emotion cues in an audio frame's userdata: a list of :class:EmotionCue.

A custom tts_node can attach cues to the frames it yields, and KeyframeAudioOutput writes them into the framed audio stream timed against the frame's audio.

Classes

class EmotionCue (emotion: Emotion,
offset: float = 0.0)
Expand source code
@dataclass(frozen=True)
class EmotionCue:
    """An emotion change timed against the audio frame that carries it.

    Attributes:
        emotion: The expression to switch to.
        offset: Seconds from the frame's first sample. May be negative (the change
            belongs to audio already sent) or run past the frame's end.
    """

    emotion: Emotion
    offset: float = 0.0

An emotion change timed against the audio frame that carries it.

Attributes

emotion
The expression to switch to.
offset
Seconds from the frame's first sample. May be negative (the change belongs to audio already sent) or run past the frame's end.

Instance variables

var emotion : Literal['neutral', 'happy', 'sad', 'angry', 'surprised', 'concerned', 'confused', 'disgusted', 'excited', 'scared', 'skeptical']
var offset : float